ElementQueryTagDependency ​
- Type
- Class
- Namespace
- craft\cache
- Inherits
- craft\cache\ElementQueryTagDependency » yii\caching\TagDependency » yii\caching\Dependency » yii\base\BaseObject
- Implements
- yii\base\Configurable
- Since
- 3.7.14
ElementQueryTagDependency is used to determine if an entry query’s cache tags have changed.
Public Properties ​
Property | Description |
---|---|
data | mixed – The dependency data that is saved in cache and later is compared with the latest dependency data. |
elementQuery | craft\elements\db\ElementQuery, null |
reusable | boolean – Whether this dependency is reusable or not. |
tags | string, array – A list of tag names for this dependency. |
elementQuery
​
- Type
- craft\elements\db\ElementQuery, null
- Default value
null
Public Methods ​
Method | Description |
---|---|
__call() | Calls the named method which is not a class method. |
__construct() | Constructor |
__get() | Returns the value of an object property. |
__isset() | Checks if a property is set, i.e. defined and not null. |
__set() | Sets value of an object property. |
__sleep() | |
__unset() | Sets an object property to null. |
canGetProperty() | Returns a value indicating whether a property can be read. |
canSetProperty() | Returns a value indicating whether a property can be set. |
className() | Returns the fully qualified name of this class. |
evaluateDependency() | Evaluates the dependency by generating and saving the data related with dependency. |
getHasChanged() | Returns a value indicating whether the dependency has changed. |
hasMethod() | Returns a value indicating whether a method is defined. |
hasProperty() | Returns a value indicating whether a property is defined. |
init() | Initializes the object. |
invalidate() | Invalidates all of the cached data items that are associated with any of the specified tags. |
isChanged() | Checks whether the dependency is changed. |
resetReusableData() | Resets all cached data for reusable dependencies. |
__construct()
​
Constructor
Arguments ​
$elementQuery
(craft\elements\db\ElementQuery)$config
(array)
__sleep()
​
Protected Methods ​
Method | Description |
---|---|
generateDependencyData() | Generates the data needed to determine if dependency has been changed. |
generateReusableHash() | Generates a unique hash that can be used for retrieving reusable dependency data. |
getTimestamps() | Returns the timestamps for the specified tags. |
touchKeys() | Generates the timestamp for the specified cache keys. |
generateDependencyData()
​
Generates the data needed to determine if dependency has been changed.
This method does nothing in this class.
Arguments ​
$cache
(yii\caching\CacheInterface) – The cache component that is currently evaluating this dependency
Returns ​
mixed
– The data needed to determine if dependency has been changed.