Ejemplo n.º 1
0
 /**
  * @override \Ackintosh\Higher\Interfaces\DML::getSql()
  */
 public function getSql()
 {
     $sql = 'UPDATE ' . $this->table->getName() . ' ';
     $sql .= $this->set->toString();
     if ($this->where) {
         $sql .= $this->where->toString();
     }
     return $sql;
 }
Ejemplo n.º 2
0
 /**
  * @test
  */
 public function toString()
 {
     $params = ['foo' => 123, 'bar' => 456];
     $set = new Set($params);
     $expect = ' SET `foo` = ?, `bar` = ?';
     $this->assertSame($expect, $set->toString(), '-> returns "SET" clause.');
 }