Nextras\Orm\Collection\ICollection::getBy PHP Method

getBy() public method

Returns IEntity filtered by conditions.
public getBy ( array $where ) : Nextras\Orm\Entity\IEntity | null
$where array
return Nextras\Orm\Entity\IEntity | null
    public function getBy(array $where);

Usage Example

 public function getIterator(IEntity $parent, ICollection $collection)
 {
     $key = $parent->getRawValue($this->metadata->name);
     return [$key ? $collection->getBy(['id' => $key]) : NULL];
 }