smart is_int() check #0

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@154 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
aterekhov
2010-10-16 15:23:46 +00:00
parent 9ce20c0092
commit 37bd5bb801

View File

@ -107,7 +107,7 @@ abstract class Model
*/ */
public function update($data, $where) public function update($data, $where)
{ {
if (is_int($where)) { if (is_int($where) || $where === (string) (int) $where) {
$where = $this->identify($this->key) . '=' . (int) $where; $where = $this->identify($this->key) . '=' . (int) $where;
} }
return $this->db->update($this->table(), $data, $where); return $this->db->update($this->table(), $data, $where);