<commit_before><?php

/**
 * This file is part of the Nextras\ORM library.
 *
 * @license    MIT
 * @link       https://github.com/nextras/orm
 * @author     <NAME>
 */

namespace Nextras\Orm\Entity\PropertyContainers;

use Nextras\Orm\Entity\IEntity;
use Nextras\Orm\Entity\IPropertyInjection;
use Nextras\Orm\Entity\Reflection\PropertyMetadata;
use Nextras\Orm\Relationships\IRelationshipCollection;
use Nextras\Orm\InvalidStateException;


class FilteredRelationshipCollectionContainer implements IPropertyInjection, \IteratorAggregate, \Countable
{
	/** @var IRelationshipCollection */
	protected $relationship;

	/** @var PropertyMetadata */
	protected $metadata;


	public function __construct(IEntity $parent, PropertyMetadata $metadata)
	{
		$this->relationship = $parent->{$metadata->args[0]};
		$this->metadata = $metadata;
	}


	public function getIterator()
	{
		return $this->relationship->getIterator($this->metadata->name);
	}


	public function count()
	{
		return $this->relationship->count($this->metadata->name);
	}


	public function setInjectedValue($value)
	{
		throw new InvalidStateException('FilteredRelationshipCollectionContainer is read-only.');
	}

}
<commit_msg>[entity] fixed property container<commit_after><?php

/**
 * This file is part of the Nextras\ORM library.
 *
 * @license    MIT
 * @link       https://github.com/nextras/orm
 * @author     <NAME>
 */

namespace Nextras\Orm\Entity\PropertyContainers;

use Nextras\Orm\Entity\IEntity;
use Nextras\Orm\Entity\IPropertyInjection;
use Nextras\Orm\Entity\Reflection\PropertyMetadata;
use Nextras\Orm\Relationships\IRelationshipCollection;
use Nextras\Orm\NotSupportedException;
use Nextras\Orm\InvalidStateException;


class FilteredRelationshipCollectionContainer implements IPropertyInjection, \IteratorAggregate, \Countable
{
	/** @var IRelationshipCollection */
	protected $relationship;

	/** @var PropertyMetadata */
	protected $metadata;


	public function __construct(IEntity $parent, PropertyMetadata $metadata)
	{
		$this->relationship = $parent->{$metadata->args[0]};
		$this->metadata = $metadata;
	}


	public function getIterator()
	{
		return $this->relationship->getIterator($this->metadata->name);
	}


	public function count()
	{
		return $this->relationship->count($this->metadata->name);
	}


	public function setInjectedValue($value)
	{
		throw new InvalidStateException('FilteredRelationshipCollectionContainer is read-only.');
	}


	public function getInjectedValue()
	{
		throw new NotSupportedException();
	}


	public function getStorableValue()
	{
		throw new NotSupportedException();
	}

}

{'fraction_non_alphanumeric': 0.12092130518234165, 'fraction_numerical': 0.0007677543186180423, 'mean_word_length': 4.977064220183486, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6722431', 'n_tokens_mistral': 825, 'n_tokens_neox': 770, 'n_words': 155}