/** * @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)); }
public function testToBindingSetList() { $this->assertEquals(ConvertArray::toBindingSetList($this->assocArray), 'a = :a, b = :b, c = :c'); }