/** * @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()); } }
/** * @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()); } }