Xpressengine\Tag\TagHandler::detach PHP Method

detach() protected method

Detach tag to taggable
protected detach ( string $taggableId, ArrayAccess | array $tags ) : void
$taggableId string taggable id
$tags ArrayAccess | array tag instances
return void
    protected function detach($taggableId, $tags)
    {
        /** @var Tag $tag */
        foreach ($tags as $tag) {
            $tag->getConnection()->table($tag->getTaggableTable())->where('tagId', $tag->getKey())->where('taggableId', $taggableId)->delete();
            $tag->decrement('count');
        }
    }