コード例 #1
0
ファイル: Client.php プロジェクト: sanpii/pomm-template-query
 public function execute(array $values = [])
 {
     $sql = $this->sql;
     $this->sql = strtr($sql, $this->parameters);
     $resource = parent::execute($values);
     $this->sql = $sql;
     return $resource;
 }
コード例 #2
0
 /**
  * getClientFromPool
  *
  * @see    ClientPooler
  * @param  string             $sql
  * @return PreparedQuery|null
  */
 protected function getClientFromPool($sql)
 {
     return $this->getSession()->getClient($this->getPoolerType(), PreparedQuery::getSignatureFor($sql));
 }
コード例 #3
0
ファイル: PreparedQuery.php プロジェクト: SebLours/Foundation
 public function testConstruct()
 {
     $this->exception(function () {
         $this->newTestedInstance(null);
     })->isInstanceOf('\\PommProject\\Foundation\\Exception\\FoundationException')->message->contains('empty query')->object($this->newTestedInstance('abcd'))->isInstanceOf('\\PommProject\\Foundation\\PreparedQuery\\PreparedQuery')->string($this->newTestedInstance('abcd')->getClientIdentifier())->isEqualTo(testedClass::getSignatureFor('abcd'));
 }