Finds and returns all cache entry identifiers which are tagged by the
specified tag.

@param string $searchedTag The tag to search for
@return array An array with identifiers of all matching entries. An empty array if no entries matched
@api
168019
public function findIdentifiersByTag(string $searchedTag): array
    {
        $entryIdentifiers = [];
        $now = $_SERVER['REQUEST_TIME'];
        $cacheEntryFileExtensionLength = strlen($this->cacheEntryFileExtension);
        for ($directoryIterator = new \DirectoryIterator($this->cacheDirectory); $directoryIterator->valid(); $directoryIterator->next()) {
            if ($directoryIterator->isDot()) {
                continue;
            }

            $cacheEntryPathAndFilename = $directoryIterator->getPathname();
            $fileSize = filesize($cacheEntryPathAndFilename);
            $index = (integer)$this->readCacheFile($cacheEntryPathAndFilename, $fileSize - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
            $metaData = $this->readCacheFile($cacheEntryPathAndFilename, $index, $fileSize - $index - self::DATASIZE_DIGITS);
            $expiryTime = (integer)substr($metaData, -self::EXPIRYTIME_LENGTH, self::EXPIRYTIME_LENGTH);
            if ($expiryTime !== 0 && $expiryTime < $now) {
                continue;
            }
            if (!in_array($searchedTag, explode(' ', substr($metaData, 0, -self::EXPIRYTIME_LENGTH)))) {
                continue;
            }

            if ($cacheEntryFileExtensionLength > 0) {
                $entryIdentifiers[] = substr($directoryIterator->getFilename(), 0, -$cacheEntryFileExtensionLength);
            } else {
                $entryIdentifiers[] = $directoryIterator->getFilename();
            }
        }
        return $entryIdentifiers;
    }
241504
public static function statusNames(string $tag): array
    {
        $status_names = [];
        foreach (self::statusCodes($tag) as $status_code) {
            $status_names[$status_code] = self::statusName($status_code);
        }
        uasort($status_names, '\Fisharebest\Webtrees\I18N::strcasecmp');

        return $status_names;
    }
1091073
public function getResourceIdsForTag($taggableType, $tag)
    {
        $results = $this->getTagsQueryBuilder($taggableType)
            ->andWhere('tag.'.$this->tagQueryField.' = :tag')
            ->setParameter('tag', $tag)
            ->select('tagging.resourceId')
            ->getQuery()
            ->execute(array(), AbstractQuery::HYDRATE_SCALAR)
        ;

        $ids = array();
        foreach ($results as $result) {
            $ids[] = $result['resourceId'];
        }

        return $ids;
    }
1285378
public function getCacheTags($tags = null)
    {
        if ($tags !== null) {
            return (array) $tags;
        }

        $tags = (array) $this->tags;
        $tags[] = static::VERSION_TAG;
        $tags[] = static::BASE_TAG;
        $tags[] = $this->from;

        if ($this->model) {
            $tags[] = get_class($this->model);
        }

        return $tags;
    }
1224338
private function getServiceListByTag($tag)
    {
        $services = [];
        $serviceIds = [];
        $serviceDefinitions = $this->container->getDefinitions();

        foreach ($tag as $tagId) {
            $serviceIds = array_merge(
                $serviceIds,
                array_keys($this->container->findTaggedServiceIds($tagId))
            );
        }

        foreach ($serviceIds as $serviceId) {
            $serviceDefinition = $serviceDefinitions[$serviceId];
            if ($serviceDefinition) {
                $services[] = [$serviceId, $serviceDefinition->getClass()];
            }
        }

        usort($services, [$this, 'compareService']);
        return $services;
    }
94363
public function getValuesByTag(string $tag): array
    {
        $result = array();

        foreach ($this->_definition as $key => $value) {
            $tags = $this->getFieldProperty($key, 'tags');

            if (is_array($tags) && in_array($tag, $tags)) {
                $result[$key] = $this->$key;
            }
        }

        return $result;
    }
709305
public function getTags ($tag)
	{
		
		$tags	= array ();
		
		foreach ($this->lines as $line)
		{
			if (strpos ($line, '@' . $tag) === 0)
			{
				$tags[]	= trim (substr ($line, strlen ('@' . $tag)));
			}
		}
		
		return $tags;
		
	}
383596
def get_tags(self, only_autocomplete = False):
        """"""
        return self._to_dict(('id', 'name', 'autocomplete'), self.conn.GetTags(only_autocomplete))
45810
public function getPostsByTag($tag)
    {
        if (false === array_key_exists($tag, $this->tagsIndex)) {
            return [];
        }

        $postNames = $this->tagsIndex[$tag];

        return $this->getPostsByName($postNames);
    }
841552
public function getFieldAnnotationsContainingMatchingTag($tag) {
        $matchingAnnotations = array();
        foreach ($this->getFieldAnnotations() as $field => $fieldAnnotations) {
            if (isset($fieldAnnotations[$tag])) {
                $matchingAnnotations[$field] = $fieldAnnotations;
            }
        }

        return $matchingAnnotations;

    }
1320680
public function getTags()
    {
        if (!$this->_extendedBackend) {
            Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
        }
        if (!($this->_backendCapabilities['tags'])) {
            Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
        }
        return $this->_backend->getTags();
    }
1261858
public function getTagsMultiple(array $keys): array
    {
        if (!is_iterable($keys)) {
            throw new CacheException('Argument $keys is not iterable.');
        }
        if (!count($keys)) {
            return [];
        }
        $keys = array_unique($keys);
        $this->validateKeys($keys);
        $return = $this->client->evalsha(
            $this->scripts[self::SCRIPT_GET_TAGS],
            count($keys),
            ...$keys,
            ...[
                self::PREFIX_KEY_VALUE,
                self::PREFIX_KEY_TAGS,
            ]
        );
        return array_map(function ($value) {
            return $value === 0 ? null : $value;
        }, array_combine($keys, $return));
    }
919095
public function checkIfTagMatchesRecords($tag)
    {
        // if tag list is empty, fetch them from the result list
        // otherwise use the cached result list
        if (!$this->tagsInSearchResult) {
            $this->tagsInSearchResult = $this->pObj->tagsInSearchResult = $this->db->getTagsFromSearchResult();
            $GLOBALS['TSFE']->fe_user->setKey('ses', 'ke_search.tagsInSearchResults', $this->tagsInSearchResult);
        }

        return array_key_exists($tag, $this->tagsInSearchResult);
    }
908599
public function tagged($tag)
    {
        if (! isset($this->tags[$tag])) {
            return [];
        }

        return new RewindableGenerator(function () use ($tag) {
            foreach ($this->tags[$tag] as $abstract) {
                yield $this->make($abstract);
            }
        }, count($this->tags[$tag]));
    }
194826
public function getTagItems(string $tag): array
    {
        $tagName = $this->getTagKey($tag);
        return explode(',', $this->handler->get($tagName));
    }
1023512
protected function driverMatcher(/*# string */ $tag)/*# : array */
    {
        $matched = [];
        foreach ($this->drivers as $id => $driver) {
            // disconnected or tag not match
            if (!$driver->ping() ||
                '' !== $tag &&
                (
                    !$driver instanceof TaggableInterface ||
                    !$driver->hasTag($tag)
                )
            ) {
                continue;
            }

            // weight factor
            $f = $this->factors[$id];
            for ($i = 0; $i < $f; ++$i) {
                $matched[] = $id;
            }
        }
        return $matched;
    }
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;
    }