/**
  * {@inheritdoc}
  */
 public function query($sql, array $parameters = [])
 {
     if (self::NEED_NEW_CONNECTION === $this->state) {
         $this->queryManager = $this->pomm->getDefaultsession()->getQueryManager();
         $this->state = self::CONNECTION_OPENED;
     }
     return $this->queryManager->query($sql, $parameters);
 }
Ejemplo n.º 2
0
 /**
  * @param string $sql
  * @param array  $parameters
  *
  * @return \PDOStatement
  */
 private function getPommIterator($sql, array $parameters)
 {
     $pommParameters = array();
     foreach ($parameters as $parameter) {
         $parameterName = ':' . trim($parameter['name'], ':');
         $sql = str_replace($parameterName, '$*', $sql);
         $pommParameters[] = $parameter['value'];
     }
     return $this->queryManager->query($sql, $pommParameters);
 }