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