public function __construct($entity, RepositoryContainer $repos) { if ($entity && !$entity instanceof Entity) { throw new InvalidArgumentException(); } $this->entity = $entity; $this->repos = $repos; parent::__construct(); }