Skip to content

Commit

Permalink
RouteEntity: Create dir in getDir method.
Browse files Browse the repository at this point in the history
  • Loading branch information
pepakriz committed Jan 12, 2014
1 parent e284e47 commit 26ff19a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CmsModule/Content/Entities/RouteEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,6 @@ public function __construct(PageEntity $page, $type)
$this->cacheMode = self::DEFAULT_CACHE_MODE;
$this->created = new \DateTime;
$this->released = new \DateTime;

$this->dir = new DirEntity;
$this->dir->setParent($this->page->getDir());
$this->dir->setInvisible(TRUE);
$this->dir->setName(Strings::webalize(get_class($this)) . Strings::random());
}


Expand Down Expand Up @@ -985,6 +980,13 @@ public function getLocale()
*/
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;
}

Expand Down

0 comments on commit 26ff19a

Please sign in to comment.