Example #1
0
 /**
  * Log query
  *
  * @param Result $result
  */
 protected function logQuery(Result $result)
 {
     $entityManager = $this->registry->getManagerForClass('Oro\\Bundle\\SearchBundle\\Entity\\Query');
     $logRecord = new QueryLog();
     $logRecord->setEntity(implode(',', array_values($result->getQuery()->getFrom())));
     $logRecord->setQuery(serialize($result->getQuery()->getCriteria()));
     $logRecord->setResultCount($result->count());
     $entityManager->persist($logRecord);
     $entityManager->flush($logRecord);
 }
Example #2
0
 public function testGetId()
 {
     $this->assertNull($this->query->getId());
 }
 /**
  * Log query
  *
  * @param \Oro\Bundle\SearchBundle\Query\Result $result
  */
 protected function logQuery(Result $result)
 {
     $logRecord = new QueryLog();
     $logRecord->setEntity(serialize($result->getQuery()->getFrom()));
     $logRecord->setQuery(serialize($result->getQuery()->getOptions()));
     $logRecord->setResultCount($result->count());
     $this->em->persist($logRecord);
     $this->em->flush();
 }