Beispiel #1
0
 /**
  * @param    int           $id           ID of row to be updated.
  * @param    mixed[]       $bindings     Bindings to be updated.
  *
  * @return   mixed[]                     Promise results with affeced row count.
  *                                       See Database->query().
  */
 public function update($id, $bindings)
 {
     $bindingSetList = ConvertArray::toBindingSetList($bindings);
     $bindings['id'] = $id;
     return $this->db->query("UPDATE {$this->table}\n            SET {$bindingSetList}\n            WHERE id = :id", ConvertArray::addPrefixToKeys($bindings));
 }
Beispiel #2
0
 public function testToBindingSetList()
 {
     $this->assertEquals(ConvertArray::toBindingSetList($this->assocArray), 'a = :a, b = :b, c = :c');
 }