/** * Cast query object to SQL string. * * @return string */ public function __toString() { if (!isset($this->cachedStatement)) { $this->cachedStatement = empty($this->partsAdd) && empty($this->partsReplace) ? $this->statement : QuerySplitter::join($this->getParts()); } return QuerySplitter::bind($this->cachedStatement, $this->params); }
public function testBind_Like_Named() { $this->assertEquals('SELECT * FROM phpunit_test WHERE description LIKE "%foo%"', QuerySplitter::bind('SELECT * FROM phpunit_test WHERE description LIKE %:desc%', array('desc' => 'foo'))); }