예제 #1
0
파일: SuluNode.php 프로젝트: sulu/sulu
 /**
  * {@inheritdoc}
  */
 public function isNew()
 {
     return $this->node->isNew();
 }
예제 #2
0
 /**
  * Iterates over all route nodes assigned by the given node, and executes the callback on it.
  *
  * @param NodeInterface $node
  * @param callable      $callback     will be called foreach route node (stops and return value if not false)
  * @param string        $webspaceKey
  * @param string        $languageCode
  * @param string        $segmentKey
  *
  * @return \PHPCR\NodeInterface
  */
 private function iterateRouteNodes(NodeInterface $node, $callback, $webspaceKey, $languageCode, $segmentKey = null)
 {
     if ($node->isNew()) {
         return;
     }
     // search for references with name 'content'
     foreach ($node->getReferences('sulu:content') as $ref) {
         if ($ref instanceof \PHPCR\PropertyInterface) {
             $routeNode = $ref->getParent();
             $resourceLocator = $this->getResourceLocator($ref->getParent()->getPath(), $webspaceKey, $languageCode, $segmentKey);
             $result = $callback($resourceLocator, $routeNode);
             if (false !== $result) {
                 return $result;
             }
         }
     }
     return;
 }
 public function testIsNew()
 {
     $this->assertFalse($this->deepnode->isNew());
 }