<commit_before><?php
/**
 * SimpleCrud\RowCollection
 * 
 * Stores a row collection of an entity
 */
namespace SimpleCrud;

class RowCollection implements \ArrayAccess, \Iterator, \Countable, \JsonSerializable, HasEntityInterface {
	private $rows = [];

	public $entity;
	public $manager;

	public function __construct (Entity $entity, array $rows = null) {
		$this->entity = $entity;
		$this->manager = $entity->manager;

		if ($rows !== null) {
			$this->add($rows);
		}
	}


	/**
	 * Magic method to execute the get method on access to undefined property
	 * 
	 * @see SimpleCrud\RowCollection::get()
	 */
	public function __get ($name) {
		return $this->get($name);
	}


	/**
	 * Returns true if is a collection, false if isn't
	 * 
	 * @return boolean
	 */
	public function isCollection () {
		return true;
	}

<commit_msg>Added magic method __toString to rowCollection<commit_after><?php
/**
 * SimpleCrud\RowCollection
 * 
 * Stores a row collection of an entity
 */
namespace SimpleCrud;

class RowCollection implements \ArrayAccess, \Iterator, \Countable, \JsonSerializable, HasEntityInterface {
	private $rows = [];

	public $entity;
	public $manager;

	public function __construct (Entity $entity, array $rows = null) {
		$this->entity = $entity;
		$this->manager = $entity->manager;

		if ($rows !== null) {
			$this->add($rows);
		}
	}


	/**
	 * Magic method to execute the get method on access to undefined property
	 * 
	 * @see SimpleCrud\RowCollection::get()
	 */
	public function __get ($name) {
		return $this->get($name);
	}


	/**
	 * Magic method to print the row values (and subvalues)
	 * 
	 * @return string
	 */
	public function __toString () {
		return "\n".$this->entity->name.":\n".print_r($this->toArray(), true)."\n";
	}


	/**
	 * Returns true if is a collection, false if isn't
	 * 
	 * @return boolean
	 */
	public function isCollection () {
		return true;
	}


{'fraction_non_alphanumeric': 0.14082278481012658, 'fraction_numerical': 0.0, 'mean_word_length': 3.4635294117647057, 'pattern_counts': {'":': 1, '<': 5, '<?xml version=': 0, '>': 16, 'https://': 0, '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': '747118', 'n_tokens_mistral': 633, 'n_tokens_neox': 569, 'n_words': 176}