コード例 #1
0
ファイル: RegexpTest.php プロジェクト: techart/tao
 /**
  * @dataProvider provider_quote
  */
 public function test_quote($src_string, $quoted_string)
 {
     $this->assertEquals(Core_Regexps::quote($src_string), $quoted_string);
 }
コード例 #2
0
ファイル: UnionMapper.php プロジェクト: techart/tao
 /**
  * 
  */
 protected function make_union_sql()
 {
     $queries = '';
     $mappers = $this->options['union'];
     $index = 0;
     foreach ($mappers as $mapper) {
         $mapper_binds = $mapper->__get('binds');
         $mapper_query = $mapper->as_string();
         foreach ($mapper_binds as $bind_name => $bind_value) {
             $mapper_query = Core_Regexps::replace('{\\:' . Core_Regexps::quote($bind_name) . '\\b}', ':' . ($bind_name = sprintf('union%d_%s', $index, $bind_name)), $mapper_query);
             $this->binds[$bind_name] = $bind_value;
         }
         $queries[] = $mapper_query;
         $index++;
     }
     return '((' . implode(') UNION (', $queries) . '))';
 }