master

laravel/framework

Last updated at: 29/12/2023 09:21

TaggableStore.php

TLDR

This file contains the TaggableStore class, which is an abstract class that implements the Store interface. It includes a method named tags() that returns a new instance of the TaggedCache class.

Methods

tags($names)

This method takes an array or a list of tag names as the input parameter and returns a new instance of the TaggedCache class. It creates a new instance of the TaggedCache class by passing the current instance of the TaggableStore class and a new instance of the TagSet class.

Classes

TaggableStore

This is an abstract class that implements the Store interface. It provides a common base implementation for cache stores that support tagging. It includes the tags() method for executing tags operations.

<?php

namespace Illuminate\Cache;

use Illuminate\Contracts\Cache\Store;

abstract class TaggableStore implements Store
{
    /**
     * Begin executing a new tags operation.
     *
     * @param  array|mixed  $names
     * @return \Illuminate\Cache\TaggedCache
     */
    public function tags($names)
    {
        return new TaggedCache($this, new TagSet($this, is_array($names) ? $names : func_get_args()));
    }
}