/**
  * Set the query options
  *
  * @param \Doctrine\ORM\Query $query
  * @param array $options
  */
 protected function setQueryOptions(Query $query, array $options = null)
 {
     if (!$options) {
         return;
     }
     if (isset($options['result_cache'])) {
         if (is_array($options['result_cache'])) {
             foreach ($options['result_cache'] as $key => $value) {
                 switch ($key) {
                     case 'enabled':
                         $query->useResultCache($value);
                         break;
                     case 'lifetime':
                         $query->setResultCacheLifetime($value);
                         break;
                     case 'id':
                         $query->setResultCacheId($value);
                         break;
                 }
             }
         }
     }
 }