public function testConstructorAndGetters()
 {
     $query = new Query();
     $query->setQuery('test123');
     $event = new PreCreateRequest($query);
     $this->assertEquals($query, $event->getQuery());
     return $event;
 }
 public function onPreCreateRequest(PreCreateRequestEvent $event)
 {
     $query = $event->getQuery();
     if (null === $query->getOption('cache_lifetime')) {
         $this->currentRequestCacheProfile = null;
         return;
     }
     $this->currentRequestCacheProfile = new CacheProfile($query->getOption('cache_key'), $query->getOption('cache_lifetime'));
 }
Beispiel #3
0
 /**
  * Event hook to capture querytype
  *
  * @param  PreCreateRequestEvent $event
  * @return void
  */
 public function preCreateRequest(PreCreateRequestEvent $event)
 {
     $this->queryType = $event->getQuery()->getType();
 }