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()); }
protected function attached($presenter) { parent::attached($presenter); if ($this->root && !$this->key) { $this->key = $this->root->getId(); } if (!$this->checkCurrentDir()) { throw new BadRequestException(); } }
/** * @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; } } } }
public function __construct() { $this->dir = new DirEntity(); $this->dir->setInvisible(TRUE); $this->dir->setName(Strings::webalize(get_class($this)) . Strings::random()); }
/** * @param AccountEntity $supplier */ public function setSupplier(AccountEntity $supplier) { if ($this->supplier !== $supplier) { $this->dir->setParent($supplier->getDir()); } $this->supplier = $supplier; }
/** * @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; }