protected function attached($presenter) { parent::attached($presenter); if (!$this->presenter instanceof Auth) { throw new InvalidStateException(); } }
public function __construct($entity, RepositoryContainer $repos) { if ($entity && !$entity instanceof Entity) { throw new InvalidArgumentException(); } $this->entity = $entity; $this->repos = $repos; parent::__construct(); }
protected function attached($presenter) { parent::attached($presenter); if (!$this->presenter instanceof Content) { throw new InvalidStateException(); } /** @var FormControl $fc */ $fc = $this->parent; if (!$fc->parent instanceof Comments) { throw new InvalidStateException(); } $this->content = $fc->parent->getContent(); }