Example #1
0
 /**
  * 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 testJoin_Set()
 {
     $sql = QuerySplitter::join(array('set' => "abc=10, @def='test'"));
     $this->assertEquals("SET abc=10, @def='test'", $sql);
 }