Query scope to eager load attached media assigned to multiple tags.
@param  \Illuminate\Database\Eloquent\Builder $q
@param  string|string[]                       $tags
@return void
497368
public function scopeWithMediaMatchAll(Builder $q, $tags = [])
    {
        $tags = (array) $tags;
        $q->with(['media' => function (MorphToMany $q) use ($tags) {
            $this->addMatchAllToEagerLoadQuery($q, $tags);
        }]);
    }
663563
public function scopeWithTag($query, $tag)
    {
        $tag = Tag::where('tag', $tag)->first();

        return $query->whereHas('tagged', function($q) use($tag) {
                            $q->where('tag_id', $tag->id);
                        });
    }
1192014
public function _processTags(&$tags)
    {
        $tagString = '';
        foreach ($tags as $key => $tag) {
            if ($key != '@text') {
                if (is_array($tag)) {
                    $hasText = FALSE;
                    foreach ($tag as $key => $tagFromGroup) {
                        if ($tagFromGroup->text($this->_doclet) != '') {
                            $hasText = TRUE;
                        }
                    }
                    if ($hasText) {
                        $tagString .= '<dt>'.$tag[0]->displayName().":</dt>\n";
                        foreach ($tag as $tagFromGroup) {
                            $tagString .= '<dd>'.$tagFromGroup->text($this->_doclet)."</dd>\n";
                        }
                    }
                } else {
                    $text = $tag->text($this->_doclet);
                    if ($text != '') {
                        $tagString .= '<dt>'.$tag->displayName().":</dt>\n";
                        $tagString .= '<dd>'.$text."</dd>\n";
                    } elseif ($tag->displayEmpty()) {
                        $tagString .= '<dt>'.$tag->displayName().".</dt>\n";
                    }
                }
            }
        }
        if ($tagString) {
            echo "<dl>\n", $tagString, "</dl>\n";
        }
    }
17286
public void setTags( Collection<String> tags ) {

		synchronized( this.tags ) {
			this.tags.clear();
			if( tags != null )
				this.tags.addAll( tags );
		}
	}
1245763
public void createTags(Reference reference, Collection<String> tags) {
		getResourceFactory()
				.getApiResource("/tag/" + reference.toURLFragment())
				.entity(tags, MediaType.APPLICATION_JSON_TYPE).post();
	}
1090257
public function filterByTags($tags)
    {
        $this->query->andWhere(
            $this->query->expr()->andX(
                $this->query->expr()->like('fv.fvTags', ':tags')
            )
        );
        $this->query->setParameter('tags', '%' . $tags . '%');
    }
502909
public function setTags($tags)
    {
        foreach ($tags as $key => $value) {
            $this->setTag($key, $value);
        }
    }
101019
public function tag($tags)
    {
        $tags = $this->makeTagsArray($tags);

        $this->addTags($tags);

        if (count($tags) > 0) {
            $this->tags()->sync(
                Tag::whereIn('tag', $tags)->pluck('id')->all()
            );

            return;
        }

        $this->tags()->detach();
    }
653314
public function add($id, array $tags)
    {
        $this->connection()->pipeline(function ($pipe) use ($id, $tags) {
            foreach ($tags as $tag) {
                $pipe->zadd($tag, $id, $id);
            }
        });
    }
365345
public function setVideoTags($tags)
    {
        $this->ensureMediaGroupIsNotNull();
        $keywords = new Zend_Gdata_Media_Extension_MediaKeywords();
        if (is_array($tags)) {
            $tags = implode(', ', $tags);
        }
        $keywords->setText($tags);
        $this->getMediaGroup()->setKeywords($keywords);
        return $this;
    }
1110381
private void pushTag(String qName) {
		final String currentTag = getCurrentTag();
		if ("".equals(currentTag)) {
			mTagStack.push(qName);
		} else {
			mTagStack.push(getCurrentTag() + "." + qName);
		}
	}
388055
public function checkTemplate($template, Tag $tag = null)
	{
		if ($this->disabled)
		{
			return;
		}

		if (!isset($tag))
		{
			$tag = new Tag;
		}

		// Load the template into a DOMDocument
		$dom = TemplateLoader::load($template);

		foreach ($this->collection as $check)
		{
			$check->check($dom->documentElement, $tag);
		}
	}
807165
public function loadMediaMatchAll($tags = [])
    {
        $tags = (array) $tags;
        $this->load(['media' => function (MorphToMany $q) use ($tags) {
            $this->addMatchAllToEagerLoadQuery($q, $tags);
        }]);

        return $this;
    }
146807
public function withTags(array $tags)
    {
        Assertion::allIsInstanceOf($tags, TagInterface::class);
        Assertion::lessOrEqualThan(\count($tags), VideoInterface::TAG_MAX_COUNT);

        $instance = clone $this;

        $instance->tags = $tags;

        return $instance;
    }
371947
public static function invalidate($tags)
    {
        if (Yii::$app->cache !== null) {
            TagDependency::invalidate(Yii::$app->cache, $tags);
        }
    }
53784
public function scopeWhereHasMedia(Builder $q, $tags, $match_all = false)
    {
        if ($match_all && is_array($tags) && count($tags) > 1) {
            return $this->scopeWhereHasMediaMatchAll($q, $tags);
        }
        $q->whereHas('media', function (Builder $q) use ($tags) {
            $q->whereIn('tag', (array) $tags);
        });
    }
819195
public function tags($tags = null)
    {
        $this->cacheTags = $tags === false ? false : $tags;
        return $this;
    }