Example #1
0
 public function __construct(Entity $translation, Repository $repository, Form\Control\Factory $formControl, Ytnuk\Orm\Grid\Control\Factory $gridControl)
 {
     parent::__construct($translation);
     $this->translation = $translation;
     $this->repository = $repository;
     $this->formControl = $formControl;
     $this->gridControl = $gridControl;
 }
Example #2
0
 protected function getViews() : array
 {
     return ['view' => function () {
         return [$this->product];
     }, 'media' => function () {
         return [$this->product];
     }] + parent::getViews();
 }
Example #3
0
 public function __construct(Entity $link, Repository $repository, Control\Factory $control, Form\Control\Factory $formControl, Ytnuk\Orm\Grid\Control\Factory $gridControl)
 {
     parent::__construct($link);
     $this->link = $link;
     $this->repository = $repository;
     $this->control = $control;
     $this->formControl = $formControl;
     $this->gridControl = $gridControl;
 }
Example #4
0
 protected function getViews() : array
 {
     return ['view' => function () {
         return [$this->post];
     }, 'item' => function () {
         return [$this->post];
     }, 'info' => function () {
         return [$this->post];
     }] + parent::getViews();
 }
Example #5
0
 protected function getViews() : array
 {
     return ['view' => function () {
         return [$this->category, $this['pagination']['posts']];
     }] + parent::getViews();
 }
Example #6
0
 public function __construct(Nextras\Orm\Entity\IEntity $entity, Factory $form)
 {
     parent::__construct($entity);
     $this->entity = $entity;
     $this->form = $form;
 }
Example #7
0
 protected function getViews() : array
 {
     return ['view' => function () {
         return [$this->page];
     }] + parent::getViews();
 }
Example #8
0
 public function offsetSet($offset, $menu)
 {
     if ($menu instanceof Entity && !$this->active && $offset === NULL) {
         $this->active = $menu;
         return;
     } elseif ($menu instanceof Ytnuk\Translation\Entity) {
         $entity = new Entity();
         $entity->title = $menu;
         $menu = $entity;
     } elseif (is_string($menu)) {
         $this->repository->attach($entity = new Entity());
         $entity->title = new Ytnuk\Translation\Entity();
         $translate = new Ytnuk\Translation\Translate\Entity();
         $translate->value = $this->translator->translate($menu);
         $entity->title->translates->add($translate);
         $this->repository->detach($entity);
         $menu = $entity;
     }
     if ($menu instanceof Entity) {
         if ($offset === NULL) {
             $this->append[] = $menu;
         } else {
             $this->append[$offset] = $menu;
         }
     } else {
         parent::offsetSet($offset, $menu);
     }
 }
Example #9
0
 protected function getViews() : array
 {
     return ['title' => TRUE, 'navbar' => TRUE] + parent::getViews();
 }