public function incoming(Entity\Content $entity) { return $this->filter(function ($el) use($entity) { /** @var Entity\Relations $el */ return $el->getToContenttype() == (string) $entity->getContenttype() && $el->getToId() === $entity->getId(); }); }