示例#1
0
 /**
  * @link       http://propel.phpdb.org/trac/ticket/425
  */
 public function testMultipleFunctionInCriteria()
 {
     $db = Propel::getServiceContainer()->getAdapter(BookPeer::DATABASE_NAME);
     try {
         $c = new Criteria();
         $c->setDistinct();
         if ($db instanceof PgsqlAdapter) {
             $c->addSelectColumn("substring(" . BookPeer::TITLE . " from position('Potter' in " . BookPeer::TITLE . ")) AS col");
         } else {
             $this->markTestSkipped('Configured database vendor is not PostgreSQL');
         }
         $stmt = BookPeer::doSelectStmt($c);
     } catch (PropelException $x) {
         $this->fail("Paring of nested functions failed: " . $x->getMessage());
     }
 }
示例#2
0
 /**
  * @link       http://propel.phpdb.org/trac/ticket/425
  */
 public function testMultipleFunctionInCriteria()
 {
     $db = Propel::getDB(BookPeer::DATABASE_NAME);
     try {
         $c = new Criteria();
         $c->setDistinct();
         if ($db instanceof DBPostgres) {
             $c->addSelectColumn("substring(" . BookPeer::TITLE . " from position('Potter' in " . BookPeer::TITLE . ")) AS col");
         } else {
             $this->markTestSkipped();
         }
         $stmt = BookPeer::doSelectStmt($c);
     } catch (PropelException $x) {
         $this->fail("Paring of nested functions failed: " . $x->getMessage());
     }
 }