Ejemplo n.º 1
0
 public function __construct(NewsletterEntity $newsletter)
 {
     $this->newsletter = $newsletter;
     $this->dir = new DirEntity();
     $this->dir->setParent($this->newsletter->route->getDir());
     $this->dir->setInvisible(TRUE);
     $this->dir->setName(Strings::webalize(get_class($this)) . Strings::random());
 }
Ejemplo n.º 2
0
 protected function attached($presenter)
 {
     parent::attached($presenter);
     if ($this->root && !$this->key) {
         $this->key = $this->root->getId();
     }
     if (!$this->checkCurrentDir()) {
         throw new BadRequestException();
     }
 }
Ejemplo n.º 3
0
 /**
  * @throws \CmsModule\Content\PermissionDeniedException
  */
 public function generatePath()
 {
     if (!$this->isAllowedToWrite()) {
         throw new PermissionDeniedException();
     }
     $old = $this->path;
     if ($this->parent && $this->parent instanceof \Doctrine\ORM\Proxy\Proxy) {
         $this->parent->__load();
     }
     $this->path = ($this->parent ? $this->parent->path . '/' : '') . Strings::webalize($this->name, '.', FALSE);
     if ($this->path == $old) {
         return;
     }
     if ($this->id) {
         if (!$this->_oldPath && $old != $this->path) {
             $this->_oldPath = $old;
         } else {
             if ($this->_oldPath && $this->_oldPath == $this->path) {
                 $this->_oldPath = NULL;
             }
         }
     }
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     $this->dir = new DirEntity();
     $this->dir->setInvisible(TRUE);
     $this->dir->setName(Strings::webalize(get_class($this)) . Strings::random());
 }
Ejemplo n.º 5
0
 /**
  * @param AccountEntity $supplier
  */
 public function setSupplier(AccountEntity $supplier)
 {
     if ($this->supplier !== $supplier) {
         $this->dir->setParent($supplier->getDir());
     }
     $this->supplier = $supplier;
 }
Ejemplo n.º 6
0
 /**
  * @return DirEntity
  */
 public function getDir()
 {
     if (!$this->dir) {
         $this->dir = new DirEntity();
         $this->dir->setParent($this->page->getDir());
         $this->dir->setInvisible(TRUE);
         $this->dir->setName(Strings::webalize(get_class($this)) . Strings::random());
     }
     return $this->dir;
 }