protected function attached($presenter)
 {
     parent::attached($presenter);
     if (!$this->presenter instanceof Auth) {
         throw new InvalidStateException();
     }
 }
Пример #2
0
 public function __construct($entity, RepositoryContainer $repos)
 {
     if ($entity && !$entity instanceof Entity) {
         throw new InvalidArgumentException();
     }
     $this->entity = $entity;
     $this->repos = $repos;
     parent::__construct();
 }
Пример #3
0
 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();
 }