Neos\Media\Domain\Model\Asset::getTags PHP Метод

getTags() публичный Метод

Return the tags assigned to this asset
public getTags ( ) : Doctrine\Common\Collections\Collection
Результат Doctrine\Common\Collections\Collection
    public function getTags()
    {
        return $this->tags;
    }

Usage Example

 /**
  * @param Asset $asset
  * @param $tagLabels
  */
 protected function assertAssetHasTags(Asset $asset, $tagLabels)
 {
     $tags = $asset->getTags();
     $tagLabels = array_combine(array_values($tagLabels), array_values($tagLabels));
     $expectedTagLabels = $tagLabels;
     foreach ($tags as $tag) {
         $this->assertArrayHasKey($tag->getLabel(), $expectedTagLabels);
         unset($expectedTagLabels[$tag->getLabel()]);
     }
     $this->assertCount(0, $expectedTagLabels);
 }