{@inheritdoc}

@param array $tags
@return void
502909
public function setTags($tags)
    {
        foreach ($tags as $key => $value) {
            $this->setTag($key, $value);
        }
    }
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;
    }
99011
public static function addTags(array $tags)
    {
        if (count($tags) === 0)
            return;

        $found = Tag::whereIn('tag', $tags)->pluck('tag')->all();

        foreach (array_diff($tags, $found) as $tag) {
            if (empty(trim($tag)) || strlen($tag) < 3)
                continue;

            try {
                $model = new Tag;
                $model->tag = trim($tag);
                $model->save();
            } catch (\Illuminate\Database\QueryException $e) {
                $context = [];
                $context['file'] = $e->getFile() ?: '';
                $context['line'] = $e->getLine() ?: '';
                $context['code'] = $e->getCode() ?: '';

                logger()->warning($e->getMessage(), $context);
            }
        }
    }
925146
public function untag($tags = null)
    {
        if ($tags === null) {
            $this->removeAllTags();

            return;
        }

        $this->removeTags(
            $this->getWorkableTags($tags)
        );
    }
713359
public function flushCachesByTag(string $tag, bool $flushPersistentCaches = false): void
    {
        $this->createAllCaches();
        /** @var FrontendInterface $cache */
        foreach ($this->caches as $identifier => $cache) {
            if (!$flushPersistentCaches && $this->isCachePersistent($identifier)) {
                continue;
            }
            $cache->flushByTag($tag);
        }
    }
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);
        }
    }
661873
public void setTags(java.util.Collection<String> tags) {
        if (tags == null) {
            this.tags = null;
            return;
        }

        this.tags = new java.util.ArrayList<String>(tags);
    }
366015
public function removeTag(\Amulen\ClassificationBundle\Entity\Tag $tags)
    {
        $this->tags->removeElement($tags);
    }
1373301
public function set_tags($tags) {
        $this->tags = [];
        foreach ($tags as $tag) {
            // We use $tag->id as the key for the array so not only it handles duplicates of the same tag being given,
            // but also it is consistent with the behaviour of set_tags_by_id() below.
            $this->tags[$tag->id] = $tag;
        }
    }
561210
public function flushByTags(array $tags)
    {
        $this->throwExceptionIfFrontendDoesNotExist();

        if (empty($tags)) {
            return;
        }

        $this->logger->debug('SFC flushByTags', [$tags]);

        $identifiers = [];
        foreach ($tags as $tag) {
            $identifiers = \array_merge($identifiers, $this->findIdentifiersByTagIncludingExpired($tag));
        }

        if ($this->isBoostMode()) {
            $this->getQueue()->addIdentifiers($identifiers);

            return;
        }

        foreach ($identifiers as $identifier) {
            $this->removeStaticFiles($identifier);
        }

        parent::flushByTags($tags);
    }
329071
public void setTags(String... tags) {
        removeAllViews();
        for (final String tag : tags) {
            appendTag(tag);
        }

        if (isAppendMode) {
            appendInputTag();
        }
    }
330018
private function group_tags(array $tags){
    $res = [];
    if ( !empty($tags) ){
      foreach ( $tags as $i => $tag ){
        // Skip the 'memberof' tag
        if ( $tag['tag'] === 'memberof' ){
          continue;
        }
        $t = $tag['tag'];
        unset($tag['tag']);
        $res[$t][] = $tag['text'] ?? $tag;
      }
    }
    return array_map(function($r){
      if ( is_array($r) && (count($r) === 1) ){
        return $r[0];
      }
      return $r;
    }, $res);
  }
412634
public function deleteNotMatchingAnyTag(array $tags)
    {
        $this->collection->batchDelete(function (\Sokil\Mongo\Expression $e) use ($tags) {
            return $e->whereNotIn(Cache::FIELD_NAME_TAGS, $tags);
        });
        
        return $this;
    }
1364217
function add_tags( $tags )
	{
		$params = array();
		if (is_array($tags) && !empty($tags)) {
			$params['tags'] = join(',', $tags);
		} else {
			$params['tags'] = $tags;
		}
		return $this->oauth->post( 'tags/create', $params);
	}
197089
public function deleteMatchingAllTags(array $tags)
    {
        $this->collection->batchDelete(function (\Sokil\Mongo\Expression $e) use ($tags) {
            return $e->whereAll(Cache::FIELD_NAME_TAGS, $tags);
        });
        
        return $this;
    }
999279
public function setTagsAttribute($tags): void
    {
        static::saved(function (self $model) use ($tags) {
            $model->syncTags($tags);
        });
    }
93787
protected function popTag(array &$tags, $tag)
    {
        if (! isset($tags[$tag->name])) {
            return null;
        }

        $size = sizeof($tags[$tag->name]);

        if ($size === 0) {
            return null;
        } else {
            return array_pop($tags[$tag->name]);
        }
    }