Sulu\Component\Content\Metadata\StructureMetadata::getPropertyByTagName PHP Méthode

getPropertyByTagName() public méthode

Return true if the structure contains a property with the given tag name.
public getPropertyByTagName ( string $tagName, $highest = true ) : PropertyMetadata
$tagName string
Résultat PropertyMetadata
    public function getPropertyByTagName($tagName, $highest = true)
    {
        $properties = $this->getPropertiesByTagName($tagName);
        if (!$properties) {
            throw new \InvalidArgumentException(sprintf('No property with tag "%s" exists. In structure "%s" loaded from "%s"', $tagName, $this->name, $this->resource));
        }
        return reset($properties);
    }

Usage Example

Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function getPropertyByTagName($tagName, $highest = true)
 {
     return $this->createLegacyPropertyFromItem($this->structure->getPropertyByTagName($tagName, $highest));
 }