示例#1
0
文件: Query.php 项目: Dren-x/mobit
 /**
  * {@inheritdoc}
  */
 protected function _doExecute()
 {
     $executor = $this->_parse()->getSqlExecutor();
     if ($this->_queryCacheProfile) {
         $executor->setQueryCacheProfile($this->_queryCacheProfile);
     }
     if ($this->_resultSetMapping === null) {
         $this->_resultSetMapping = $this->_parserResult->getResultSetMapping();
     }
     // Prepare parameters
     $paramMappings = $this->_parserResult->getParameterMappings();
     if (count($paramMappings) != count($this->parameters)) {
         throw QueryException::invalidParameterNumber();
     }
     list($sqlParams, $types) = $this->processParameterMappings($paramMappings);
     return $executor->execute($this->_em->getConnection(), $sqlParams, $types);
 }
示例#2
0
文件: Query.php 项目: josercl/forum
 /**
  * {@inheritdoc}
  */
 protected function _doExecute()
 {
     $executor = $this->_parse()->getSqlExecutor();
     if ($this->_queryCacheProfile) {
         $executor->setQueryCacheProfile($this->_queryCacheProfile);
     }
     if ($this->_resultSetMapping === null) {
         $this->_resultSetMapping = $this->_parserResult->getResultSetMapping();
     }
     // Prepare parameters
     $paramMappings = $this->_parserResult->getParameterMappings();
     if (count($paramMappings) != count($this->parameters)) {
         throw QueryException::invalidParameterNumber();
     }
     // evict all cache for the entity region
     if ($this->hasCache && isset($this->_hints[self::HINT_CACHE_EVICT]) && $this->_hints[self::HINT_CACHE_EVICT]) {
         $this->evictEntityCacheRegion();
     }
     list($sqlParams, $types) = $this->processParameterMappings($paramMappings);
     return $executor->execute($this->_em->getConnection(), $sqlParams, $types);
 }