findByName() public method

Loads the tag with the given name.
public findByName ( $name ) : Tag
$name
return Sulu\Bundle\TagBundle\Entity\Tag
Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function exportData($propertyValue)
 {
     if (false === is_array($propertyValue)) {
         return '';
     }
     foreach ($propertyValue as &$propertyValueItem) {
         if (is_string($propertyValueItem)) {
             $tag = $this->tagManager->findByName($propertyValueItem);
             if ($tag) {
                 $propertyValueItem = $tag->getId();
             }
         }
     }
     if (!empty($propertyValue)) {
         return json_encode($propertyValue);
     }
     return '';
 }