Get all the tags of this block with a specific tag name.

@param string $name The tag name to search for.

@return array<DocumentationTag> The tags with a matching tag name.
1062
public function tagsByName($name)
    {
        $tags = array();
        foreach ($this->tags() as $tag) {
            if ($name === $tag->name()) {
                $tags[] = $tag;
            }
        }

        return $tags;
    }
861902
public function taggedWith($tag)
    {
        $results = [];

        if (isset($this->tags[$tag]))
        {
            foreach ($this->tags[$tag] as $view)
            {
                $results[] = $view;
            }

        }

        return $results;
    }
544357
private function getAllTags()
    {
        if ($comment = $this->getDocComment()) {
            if (preg_match_all("/\@(\w+)(.*)/", $comment, $m)) {
                foreach ($m[0] as $i => $result) {
                    $tagName = $m[1][$i];
                    $tagValue = trim($m[2][$i]);
                    $this->setTag($tagName, $tagValue);
                }
            }
        }
    }
577325
public function findOneByName($name)
    {
        $qb = $this->getQueryBuilder();

        return $qb
            ->leftJoin('c.containers', 'container')
            ->leftJoin('container.rows', 'row')
            ->leftJoin('row.blocks', 'block')
            ->leftJoin('block.translations', 'block_t')
            ->addSelect('container', 'row', 'block', 'block_t')
            ->andWhere($qb->expr()->eq('c.name', ':name'))
            ->getQuery()
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, Content::getEntityTagPrefix() . '[name:'.$name.']')
            ->setParameter('name', $name)
            ->getOneOrNullResult();
    }
947268
protected function collectExtensions($name)
    {

        $extensions = [];

        foreach ($this->extensions() as $pattern) {
            if ($this->patternMatches($pattern, $name)) {
                $extensions[] = $this->getExtension($pattern);
            }
        }

        return $extensions;

    }
409562
public function getByTag(string $tag): array
    {
        $result = [];
        if (isset($this->tags[$tag])) {
            foreach ($this->tags[$tag] as $id) {
                $result[$id] = $this->get($id);
            }
        }

        return $result;
    }
547880
public function getFirstTag($name)
    {
        foreach ($this->tags as $i => $tag) {
            if (strtolower($tag->getName()) == $name) {
                return $this->tags[$i];
            }
        }

        return null;
    }
451621
public function findAll(array $names)
    {
        $tags = $this->all();
        $transformTags = function($array) {
                $newArray = array();
                foreach($array as $entry){
                    $newArray[$entry['name']] = $entry;
                }
                return $newArray;
            };
        $tagNames = $transformTags($tags);
        $found = array(
            'tags' => array(),
            'notFound' => array()
        );
        foreach ($names as $name){
            if (in_array($name, array_keys($tagNames))){
                $found['tags'][] = $tagNames[$name];
            } else {
                $found['notFound'][] = $name;
            }
        }
        return $found;
    }
48843
public function getTags(
        User $user = null,
        $search = '',
        $withPlatform = false,
        $orderedBy = 'name',
        $order = 'ASC',
        $withPager = false,
        $page = 1,
        $max = 50,
        $strictSearch = false
    )
    {
        $tags = is_null($user) ?
            $this->getPlatformTags(
                $search,
                $orderedBy,
                $order,
                $withPager,
                $page,
                $max,
                $strictSearch
            ) :
            $this->getUserTags(
                $user,
                $search,
                $withPlatform,
                $orderedBy,
                $order,
                $withPager,
                $page,
                $max,
                $strictSearch
            );

        return $tags;
    }
734389
public function getItems($name = '')
    {
        if (empty($name)) {
            return $this->items;
        }

        if (! isset($this->items[$name])) {
            return false;
        }

        return $this->items[$name];
    }
440669
private function getAllTags(){
        if($comment = $this->getDocComment()){
            if(preg_match_all("/\@(\w+)(.*)/", $comment,$m)){
                foreach($m[0] as $i=>$result){
                    $tag = $m[1][$i];
                    $tagValue = trim($m[2][$i]);
                    $this->{"_{$tag}"} = $tagValue;
                }
            }
        }
    }
993493
public function getPartsByName($name)
    {
        $parts = array();

        foreach ($this->getParts() as $part) {
            if ($part->getName() === $name) {
                $parts[] = $part;
            }
        }

        return $parts;
    }
379812
public function getTermsByVocabularyNameAsArray($name) {
    $vocabulary = \Taxonomy::getVocabularyByName($name);

    $term_relations = $this->related()->where('vocabulary_id', $vocabulary->id)->get();

    $data = [];
    foreach ($term_relations as $term_relation) {
      $data[$term_relation->term->id] = $term_relation->term->name;
    }

    return $data;
  }
167215
public function tag($name) {
		if (!isset($this->_tags[$name])) {
			return false;
		}
		foreach ($this->_tags[$name] as $item) {
			return $item;
		}
	}
534592
public function getTag($tagName)
    {
        foreach ($this->tags as $tag) {
            if ($tag['name'] === $tagName) {
                return $tag;
            }
        }

        throw new \InvalidArgumentException(sprintf(
            'Unknown tag "%s"', $tagName
        ));
    }
865043
public function getTagMedia($name, $limit = 0)
    {
        $params = array();

        if ($limit > 0) {
            $params['count'] = $limit;
        }

        return $this->_makeCall('tags/' . $name . '/media/recent', false, $params);
    }
857785
protected function getList($name)
    {
        if (null === ($list = $this->cache->get($name)) || !\is_array($list)) {
            return [];
        }

        return $list;
    }