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