Ejemplo n.º 1
0
 public function getCurrentScope()
 {
     if (!$this->currentScope) {
         $scope = new TreeScope();
         $scope->setModelRootId(Config::get($this->configKey));
         return $scope;
     }
     return $this->currentScope;
 }
Ejemplo n.º 2
0
 /**
  * Convert a root node to a scope
  *
  * @param \Cmsable\Model\SiteTreeNodeInterface $node
  * @return \Cmsable\Routing\TreeScope\TreeScope
  **/
 public function node2Scope(SiteTreeNodeInterface $node)
 {
     $scope = new TreeScope();
     $urlSegment = trim($node->getUrlSegment(), '/');
     $name = $urlSegment ? $urlSegment : TreeScope::DEFAULT_NAME;
     $scope->setPathPrefix($node->getUrlSegment());
     $scope->setName($name);
     $scope->setTitle($node->getMenuTitle());
     $scope->setModelRootId($node->{$this->treeModel->rootCol()});
     return $scope;
 }