Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function isNew()
 {
     return $this->node->isNew();
 }
Ejemplo n.º 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());
 }