public function testHashWithArray()
 {
     $a = new Expressions(null, array('id' => 1, 'name' => array('Tito', 'Mexican')));
     $this->assertEquals('id=? AND name IN(?,?)', $a->toS());
 }
 public function test_hash_with_array()
 {
     $a = new Expressions(null, array('id' => 1, 'name' => array('Tito', 'Mexican')));
     $this->assert_equals('id=? AND name IN(?,?)', $a->to_s());
 }
Example #3
0
 private function buildInsert()
 {
     require_once 'Expressions.php';
     $keys = \join(',', $this->quotedKeyNames());
     if ($this->sequence) {
         $sql = "INSERT INTO {$this->table}({$keys}," . $this->connection->quoteName($this->sequence[0]) . ") VALUES(?," . $this->connection->nextSequenceValue($this->sequence[1]) . ")";
     } else {
         $sql = "INSERT INTO {$this->table}({$keys}) VALUES(?)";
     }
     $e = new Expressions($this->connection, $sql, \array_values($this->data));
     return $e->toString();
 }