コード例 #1
0
 private function getTitle(Node $parentNode = null)
 {
     $title = $this->properties->getWidgetProperty(self::PROPERTY_TITLE);
     if (!$title) {
         return null;
     } elseif ($title == 1) {
         if (!$parentNode) {
             $parentNodeId = $this->getParent();
             if (!$parentNodeId) {
                 return null;
             }
             try {
                 $node = $this->properties->getNode();
                 $parentNode = $this->cms->getNode($node->getRootNodeId(), $node->getRevision(), $parentNodeId);
             } catch (NodeNotFoundException $exception) {
                 $this->getLog()->logException($exception);
                 return;
             }
         }
         if ($parentNode) {
             $title = $parentNode->getName($this->locale);
         } else {
             $title = null;
         }
     }
     return $title;
 }