CacheLifetimeOperation
class CacheLifetimeOperation extends AbstractOperation (View source)
"cacheLifetime" operation working on ContentRepository nodes. Will get the minimum of all allowed cache lifetimes for the nodes in the current FlowQuery context. This means it will evaluate to the nearest future value of the hiddenBeforeDateTime or hiddenAfterDateTime properties of all nodes in the context. If none are set or all values are in the past it will evaluate to NULL.
To include already hidden nodes (with a hiddenBeforeDateTime value in the future) in the result, also invisible nodes have to be included in the context. This can be achieved using the "context" operation before fetching child nodes.
Example:
q(node).context({'invisibleContentShown': true}).children().cacheLifetime()
Properties
static protected string | $shortName | {@inheritdoc} | |
static protected int | $priority | {@inheritdoc} | |
static protected bool | $final | {@inheritdoc} | |
protected Now | $now |
Methods
{@inheritdoc}
{@inheritdoc}
Details
bool
canEvaluate(array $context)
{@inheritdoc}
int
evaluate(FlowQuery $flowQuery, array $arguments)
{@inheritdoc}