Sync tags for model.

@param Model $model
@param array $tags

@return null
422608
protected function syncTags(Model $model, array $tags)
    {
        if (!method_exists($model, 'tags')) {
            Log::info('Model doesn’t have a method called tags');

            return false;
        }

        // Create or add tags
        $tagIds = [];

        if ($tags) {
            $found = Tags::findOrCreate($tags);
            foreach ($found as $tag) {
                $tagIds[] = $tag->id;
            }
        }

        // Assign tags to model
        $model->tags()->sync($tagIds);
    }
768606
public function create( $model, $config = [] ) {

		$model = parent::create( $model, $config );

		$content = isset( $config[ 'content' ] ) ? $config[ 'content' ] : null;

		// Model content is required for all the tags to form tag page
		if( !isset( $content ) ) {

			$content = new ModelContent();
		}

		$config[ 'parent' ]		= $model;
		$config[ 'parentType' ]	= self::$parentType;

		$this->modelContentService->create( $content, $config );

		return $model;
	}
933337
public function addRenderTags($tags)
    {
        $i[0] = 0;
        foreach($tags as $tag => $text) {
            if(is_array($text)) {
                $i[1] = 0;
                foreach($text as $tag1 => $text1) {
                    $temp[$i[0]][$i[1]] = $this->createTag($tag1, $text1);
                }
                $temp[$i[0]] = implode("\n", $temp[$i[0]]);
            }
            else {
                $temp[$i[0]] = $this->createTag($tag, $text);
            }
            $i[0]++;
        }
        $this->tempView = implode("\n", $temp);
    }
721730
public static function invalidateTags(array $tags)
    {
        $cache = self::getCacheService()->user();
        if ($cache instanceof TagAwareAdapterInterface) {
            $cache->invalidateTags($tags);
        }
    }
1302484
public function addTags(array $tags)
    {
        $this->tagsChanges['added'] = array_unique(
            array_merge($this->tagsChanges['added'], $tags)
        );

        return $this;
    }
1304778
public function updateNode($model)
    {
        $this->validate(['model' => $model]);
        
        $query = null;
        
        $data = $this->con->getData($con, $query);
        
        $params = [
            'index' => $this->client->getIndex(),
            'type'  => $model->tableName(),
            'id'    => $data[0][$this->idColumn],
            'body'  => ['doc' => $data[0]]
        ];
        
        $responses = $this->client->getClient()->update($params);
        return $responses['result'];
    }
1223527
public static function createTagFromModel(Model $model)
    {
        return new Tag((string) $model->id, $model->name, $model->row());
    }
1138173
public static function clearTags(array $tags): bool
    {
        if (self::getInstance() instanceof HierarchicalPoolInterface) {
            return self::getInstance()->invalidateTags($tags);
        }
        return false;
    }
17286
public void setTags( Collection<String> tags ) {

		synchronized( this.tags ) {
			this.tags.clear();
			if( tags != null )
				this.tags.addAll( tags );
		}
	}
1030434
public function check(Model $model, array $parameters = [])
    {
        $this->model      = $model;
        $this->parameters = $parameters;

        return $this->performCheck();
    }
140710
protected function tagExists($tagName, array $tags)
    {
        foreach ($tags as $tag) {
            if ($tag['tag'] == $tagName) {
                if (array_key_exists('merge_id', $tag)) {
                    return $tag['merge_id'];
                }
                return true;
            }
        }
        return false;
    }
829854
public function addTag(Tag $tag)
    {
        if (!$this->tags->contains($tag)) {
            $this->tags->add($tag);
            return true;
        }
        return false;
    }
1284007
public function addTags($tags = array())
	{
		if (!is_array($tags)) {
			$tags = func_get_args();
		}
		foreach ($tags as $tagAttributes) {
			$this->addTag($tagAttributes);
		}
	}
153803
public function addTags(array $tags, Taggable $resource)
    {
        foreach ($tags as $tag) {
            if ($tag instanceof Tag) {
                $this->addTag($tag, $resource);
            }
        }
    }
58162
public function flush($tags = null)
    {
        $tags = $this->getCacheTags($tags);

        $this->flushKeysForTags($tags);
    }
302467
public function update(Tag $model, UpdateRequest $request)
    {
        $model->update( $request->all() );

        \Cache::tags('response')->flush();

        return $this->successJsonResponse();
    }
502909
public function setTags($tags)
    {
        foreach ($tags as $key => $value) {
            $this->setTag($key, $value);
        }
    }