getPropertyByTagName() 공개 메소드

returns a property instance with given tag name.
public getPropertyByTagName ( string $tagName, $highest = true ) : Sulu\Component\Content\Compat\PropertyInterface
$tagName string
$highest
리턴 Sulu\Component\Content\Compat\PropertyInterface
예제 #1
0
 /**
  * Returns select of a single structure with title and url selector.
  */
 private function buildSelectForStructure($locale, StructureInterface $structure, &$names)
 {
     $nodeNameProperty = $structure->getProperty('title');
     $result = '';
     $name = $this->getTranslatedProperty($nodeNameProperty, $locale)->getName();
     if (!in_array($name, $names)) {
         $names[] = $name;
         $result .= ', ' . $this->buildSelector($name);
     }
     if ($structure->hasTag('sulu.rlp')) {
         $urlProperty = $structure->getPropertyByTagName('sulu.rlp');
         $name = $this->getTranslatedProperty($urlProperty, $locale)->getName();
         if ($urlProperty->getContentTypeName() !== 'resource_locator' && !in_array($name, $names)) {
             $names[] = $name;
             $result .= ', ' . $this->buildSelector($name);
         }
     }
     return $result;
 }