当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Data_Tree_Node::setLevel方法代码示例

本文整理汇总了PHP中Varien_Data_Tree_Node::setLevel方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Tree_Node::setLevel方法的具体用法?PHP Varien_Data_Tree_Node::setLevel怎么用?PHP Varien_Data_Tree_Node::setLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Data_Tree_Node的用法示例。


在下文中一共展示了Varien_Data_Tree_Node::setLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _addChildNodes

 protected function _addChildNodes($children, $path, $parentNode, $withChildren = false, $level = 0)
 {
     if (isset($children[$path])) {
         foreach ($children[$path] as $child) {
             $nodeId = isset($child[$this->_idField]) ? $child[$this->_idField] : false;
             if ($parentNode && $nodeId && ($node = $parentNode->getChildren()->searchById($nodeId))) {
                 $node->addData($child);
             } else {
                 $node = new Varien_Data_Tree_Node($child, $this->_idField, $this, $parentNode);
                 $node->setLevel($node->getData($this->_levelField));
                 $node->setPathId($node->getData($this->_pathField));
                 $this->addNode($node, $parentNode);
             }
             if ($withChildren) {
                 $this->_loaded = false;
                 $node->loadChildren(1);
                 $this->_loaded = false;
             }
             if ($path) {
                 $childrenPath = explode('/', $path);
             } else {
                 $childrenPath = array();
             }
             $childrenPath[] = $node->getId();
             $childrenPath = implode('/', $childrenPath);
             $this->_addChildNodes($children, $childrenPath, $node, $withChildren, $level + 1);
         }
     }
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:29,代码来源:Dbp.php

示例2: addChildNodes

 public function addChildNodes($children, $path, $parentNode, $level = 0)
 {
     if (isset($children[$path])) {
         foreach ($children[$path] as $child) {
             $node = new Varien_Data_Tree_Node($child, $this->_idField, $this, $parentNode);
             $node->setLevel(count(explode('/', $node->getData($this->_pathField))));
             $node->setPathId($node->getData($this->_pathField));
             $this->addNode($node, $parentNode);
             if ($path) {
                 $childrenPath = explode('/', $path);
             } else {
                 $childrenPath = array();
             }
             $childrenPath[] = $node->getId();
             $childrenPath = implode('/', $childrenPath);
             $this->addChildNodes($children, $childrenPath, $node, $level + 1);
         }
     }
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:19,代码来源:Dbp.php


注:本文中的Varien_Data_Tree_Node::setLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。