validateRecord() protected method

This function has the ability to change the isHit property as well as the record passed.
protected validateRecord ( array $validation, &$record )
$validation array
Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function validateRecord($validation, &$record)
 {
     $expiration = $_ =& $record['expiration'];
     if (isset($record['data'], $record['data']['return']) && is_array($record['data']['return']) && isset($record['data']['return'][static::DATA_FIELD], $record['data']['return'][static::TAGS_FIELD]) && !empty($record['data']['return'][static::TAGS_FIELD])) {
         $tags = $record['data']['return'][static::TAGS_FIELD];
         foreach ($this->getTagItems(array_keys($record['data']['return'][static::TAGS_FIELD])) as $tag => $tagItem) {
             $tagVersion = $tagItem->get();
             if ($tagVersion !== $tags[$tag]) {
                 unset($record['expiration']);
                 break;
             }
         }
     }
     parent::validateRecord($validation, $record);
     if ($expiration !== null) {
         $record['expiration'] = $expiration;
     }
 }