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


PHP Node::getPath方法代码示例

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


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

示例1: getPath

 /**
  * @return string
  */
 public function getPath()
 {
     if ($this->path === null) {
         if ($this->parent === null || $this->parent->getPath() === null) {
             $this->path = $this->name;
         } else {
             $this->path = $this->parent->getPath() . '/' . $this->name;
         }
     }
     return $this->path;
 }
开发者ID:dav-m85,项目名称:busfactor,代码行数:14,代码来源:Node.php

示例2: getPath

 public function getPath(&$prevNodes = [])
 {
     if ($this->_parent) {
         array_push($prevNodes, $this);
         $this->_parent->getPath($prevNodes);
     }
     return $prevNodes;
 }
开发者ID:schpill,项目名称:standalone,代码行数:8,代码来源:Node.php

示例3: testConstructFromArray

 /**
  *
  * @dataProvider testConstructFromArrayProvider
  */
 public function testConstructFromArray($testData, $expectedData)
 {
     $n = new Node($testData);
     extract($expectedData);
     $this->assertEquals($path, $n->getPath());
     $this->assertEquals($url, $n->url);
     $this->assertEquals($template_data, $n->template_data);
     $this->assertEquals($display_name, $n->display_name);
 }
开发者ID:unstoppablecarl,项目名称:navinator,代码行数:13,代码来源:NodeTest.php

示例4: checkLocks

 private function checkLocks(Node $node)
 {
     if ($node->isLocked()) {
         throw new LockException("cannot move locked node: {$this->workspace}=>" . $node->getPath());
     } else {
         if ($node->hasNodes()) {
             $ni = $node->getNodes();
             while ($ni->hasNext()) {
                 $temporaryNode = $ni->nextNode();
                 if ($temporaryNode->hasNodes()) {
                     $this->checkLocks($temporaryNode);
                 } else {
                     if ($temporaryNode->isLocked()) {
                         throw new LockException("cannot move locked node: {$this->workspace}=>" . $temporaryNode->getPath());
                     }
                 }
             }
         }
     }
 }
开发者ID:samueljwilliams,项目名称:pcr,代码行数:20,代码来源:Session.php

示例5: _find

 /**
  * Internal recursion for find()
  *
  * @param array $ret
  * @param \USync\AST\NodeInterface[] $node
  * @param int $depth
  *
  * @return \USync\AST\NodeInterface[]
  */
 protected function _find(&$ret, Node $node, $depth = 0)
 {
     $current = $this->segments[$depth];
     if (self::MATCH === $current[0] || self::WILDCARD === $current || $node->getName() === $current) {
         if ($depth === $this->size) {
             $ret[$node->getPath()] = $node;
         } else {
             foreach ($node->getChildren() as $child) {
                 $this->_find($ret, $child, $depth + 1);
             }
         }
     }
 }
开发者ID:makinacorpus,项目名称:drupal-usync,代码行数:22,代码来源:Path.php

示例6: getQuery

 /**
  * 
  * Retrieves an existing persistent query.
  * If node is not a valid persisted query, an InvalidQueryException is thrown.
  * Persistent queries are created by first using QueryManager->createQuery to create a Query object and then calling Query->storeAsNode to persist the query to a location in the workspace.
  * @param Node $node a persisted query.
  * @return Query a Query object.
  * 
  */
 public function getQuery(Node $node)
 {
     Log4PCR::info("Requested query: {$this->workspace}=>" . $node->getPath());
     return new Query($this->pm, $node->getProperty('pcr:statement')->getString());
 }
开发者ID:samueljwilliams,项目名称:pcr,代码行数:14,代码来源:QueryManager.php


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