Lazy eager load media attached to items in the collection bound all of the provided tags simultaneously.
@param  string|string[]  $tags
If one or more tags are specified, only media attached to those tags will be loaded.
@return $this
349270
public function loadMediaMatchAll($tags = [])
    {
        $tags = (array) $tags;
        $closure = function (MorphToMany $q) use ($tags) {
            $this->addMatchAllToEagerLoadQuery($q, $tags);
        };
        $closure = Closure::bind($closure, $this->first(), $this->first());

        return $this->load(['media' => $closure]);
    }
582747
private function _mangleTags($tags)
    {
        foreach ($tags as $i => $tag) {
            $tags[$i] = $this->_mangleTag($tag);
        }
        return $tags;
    }
1251220
public TagResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
383891
public function withTag(string $tag): self
    {
        if ($this->has($tag)) {
            return $this;
        }
        self::validateTag($tag);
        $newTags = $this->tags;
        $newTags[] = $tag;
        return new static($newTags);
    }
663030
public function tag($tags)
    {
        foreach ($this->prepareTags($tags) as $tag) {
            $this->addTag($tag);
        }

        return true;
    }
1028549
public function prune(array $tags)
    {
        if (!count($tags)) {
            return $this;
        }

        $first = array_shift($tags);
        $query = $this->storage->where('tags', 'like', "%|$first|%");

        foreach ($tags as $tag) {
            $query = $query->orWhere('tags', 'like', "%|$tag|%");
        }

        $deletedIds = [];

        foreach ($query as $cacheId=>$entry) {

            $this->entryCache[$cacheId] = $this->createMissEntry();
            $deletedIds[] = $cacheId;

        }

        $this->writeStorage->clear($deletedIds);

        if ($this->bigStorage) {
            $this->bigStorage->clear($deletedIds);
        }

        return $this;
    }
39248
private function tag($tags)
    {
        $this->initialize();

        if (!is_array($tags)) {
            $tags = [$tags];
        }
        foreach ($tags as $tag) {
            if (!is_string($tag)) {
                throw new InvalidArgumentException(sprintf('Cache tag must be string, "%s" given', is_object($tag) ? get_class($tag) : gettype($tag)));
            }
            if (isset($this->tags[$tag])) {
                continue;
            }
            if (!isset($tag[0])) {
                throw new InvalidArgumentException('Cache tag length must be greater than zero');
            }
            if (isset($tag[strcspn($tag, '{}()/\@:')])) {
                throw new InvalidArgumentException(sprintf('Cache tag "%s" contains reserved characters {}()/\@:', $tag));
            }
            $this->tags[$tag] = $tag;
        }

        return $this;
    }
932982
public function attachTags(&$holders)
    {
        $tagHolders = $holders instanceof HoldsTags ? [$holders] : $holders;

        if (!$holder = $this->findFirst($tagHolders)) {
            return $this;
        }

        $resourceName = $holder->resourceName();

        if (!$tags = $this->tagsByForeignId($this->collectIds($tagHolders), $resourceName)) {
            return $this;
        }

        foreach ($tagHolders as $holder) {
            $foreignId = $holder->getKey();
            if (!isset($tags[$foreignId])) {
                continue;
            }
            foreach ($tags[$foreignId] as $tag) {
                $holder->attachTag($tag);
            }
        }
        return $this;
    }
55731
public function publishedTags($publishedTags = [])
    {
        if (count($publishedTags) <= 0) {
            return $this->publishedTags;
        }

        $this->publishedTags = $publishedTags;
        return $this;
    }
230735
public function syncMedia($media, $tags)
    {
        $this->detachMediaTags($tags);
        $this->attachMedia($media, $tags);
    }
12438
public function tags(array $tags)
    {
        $this->tags = array_unique(array_merge($this->tags, $tags));

        return $this;
    }
202858
public function setTags($tags)
    {
        $this->_tags = $tags;
        $this->_tagsDirty = true;
        $this->_currentTags = null;
    }
1015849
public function flush($tag) {
        $args = func_get_args();
        foreach ($args as $item) {
            if (in_array($item, $this->sequence)) {
                $this->$item = [];
            }
        }
        return $this;
    }
56856
public function prune(array $tags)
    {
        foreach ($tags as $tag) {
            $this->cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$tag]);
        }

        return $this;
    }
1090257
public function filterByTags($tags)
    {
        $this->query->andWhere(
            $this->query->expr()->andX(
                $this->query->expr()->like('fv.fvTags', ':tags')
            )
        );
        $this->query->setParameter('tags', '%' . $tags . '%');
    }
43123
public function addTag($tag)
    {
        $this->tags[] = (string)$tag;
        $this->ref = null;
        return $this;
    }
308269
public function MetaTags(&$tags)
    {
        // Only attempt to replace <title> tag if it has been included, as it won't
        // be included if called via $MetaTags(false)
        if (preg_match("/<title>(.+)<\/title>/i", $tags)) {
            $format = Config::inst()->get(static::class, 'title_format');

            $data = ArrayData::create([
                'MetaTitle' => $this->owner->MetaTitle ? $this->owner->obj('MetaTitle') : $this->owner->obj('Title')
            ]);

            $newTitleTag = HTML::createTag('title', [], SSViewer::execute_string($format, $data));
            $tags = preg_replace("/<title>(.+)<\/title>/i", $newTitleTag, $tags);
        }
    }