コード例 #1
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;
 }