Beispiel #1
0
 /**
  * @param  mixed[]    $bindings   Column names and values of the entry.
  * @return mixed[]                Promise results with affected row count.
  *                                See Database->query().
  */
 public function create($bindings = array())
 {
     $lists = ConvertArray::toQueryLists($bindings);
     return $this->db->query("INSERT INTO {$this->table} ({$lists['columns']})\n            VALUES ({$lists['bindings']})", ConvertArray::addPrefixToKeys($bindings));
 }
Beispiel #2
0
 public function testToQueryLists()
 {
     $lists = ConvertArray::toQueryLists($this->assocArray);
     $this->assertEquals($lists['columns'], 'a, b, c');
     $this->assertEquals($lists['bindings'], ':a, :b, :c');
 }