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