. */ namespace Doctrine\ORM\Cache; use Doctrine\ORM\Cache\QueryCacheEntry; use Doctrine\ORM\Cache\QueryCacheKey; /** * @since 2.5 * @author Fabio B. Silva */ class TimestampQueryCacheValidator implements QueryCacheValidator { /** * {@inheritdoc} */ public function isValid(QueryCacheKey $key, QueryCacheEntry $entry) { if ($key->lifetime == 0) { return true; } return ($entry->time + $key->lifetime) > time(); } }