예제 #1
0
파일: Database.php 프로젝트: dakulov/DbEasy
 /**
  * @param PlaceholderAbstract $placeholder
  * @return void
  */
 public function addCustomPlaceholder(PlaceholderAbstract $placeholder)
 {
     if (!empty($this->adapter)) {
         $placeholder->setQuotePerformer($this->adapter);
     }
     $this->placeholders->addPlaceholder($placeholder);
 }
예제 #2
0
 public function testTransformQuery_CustomAdapterCustomPlaceholderWithCommonNativePlaceholderWithoutExpandValueFewValues()
 {
     $myAdapter = Helper::getMockCustomAdapter();
     $placeholders = new PlaceholderCollection();
     $placeholders->addPlaceholder(Helper::getMockCustomPlaceholder('?m'));
     $transformer = new QueryTransformer($myAdapter, $placeholders);
     $result = $transformer->transformQuery(Query::create('SQL_TEXT ?m, ?m SQL_TEXT', ['in1']), false);
     $this->assertEquals('SQL_TEXT ?, ERROR_NO_VALUE SQL_TEXT', $result->getQueryAsText());
     $this->assertSame(['out1'], $result->getValues());
 }