App\services\Media::setTags PHP Method

setTags() public method

If the input array is empty or contains only invalid items, we use all tags. Otherwise, we only use the valid items in it.
public setTags ( array $tags = [] )
$tags array
    public function setTags($tags = [])
    {
        $this->tags = array_intersect((array) $tags, $this->allTags) ?: $this->allTags;
        // We always keep track of mtime.
        if (!in_array('mtime', $this->tags, true)) {
            $this->tags[] = 'mtime';
        }
    }