FetchColumn method, #16

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@132 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
pzinovkin
2010-03-17 20:52:23 +00:00
parent 6feb571779
commit 2aeaedc2ef
2 changed files with 16 additions and 2 deletions

View File

@ -117,12 +117,14 @@ abstract class Model implements iCacheable
}
/**
* @param mixed $where
* @param int|array $where Int or array ids
* @return int Number of affected rows
*/
public function delete($where)
{
if (is_int($where)) {
if (is_array($where)) {
$where = $this->identify($this->key) . ' IN (' . $this->quote($where) . ')';
} else {
$where = $this->identify($this->key) . '=' . (int) $where;
}
return $this->db->delete($this->table(false), $where);