Neos\ContentRepository\Domain\Model\NodeInterface::getParent PHP Метод

getParent() публичный Метод

Returns the parent node of this node
public getParent ( ) : Neos\ContentRepository\Domain\Model\NodeInterface
Результат Neos\ContentRepository\Domain\Model\NodeInterface The parent node or NULL if this is the root node
    public function getParent();

Usage Example

 /**
  * @param NodeInterface $contextNode The node for which the preceding node should be found
  * @return NodeInterface The preceding node of $contextNode or NULL
  */
 protected function getPrevForNode($contextNode)
 {
     $nodesInContext = $contextNode->getParent()->getChildNodes();
     for ($i = 0; $i < count($nodesInContext) - 1; $i++) {
         if ($nodesInContext[$i + 1] === $contextNode) {
             return $nodesInContext[$i];
         }
     }
     return null;
 }
All Usage Examples Of Neos\ContentRepository\Domain\Model\NodeInterface::getParent