| @@ 121-131 (lines=11) @@ | ||
| 118 | * |
|
| 119 | * @return array of object of this class |
|
| 120 | */ |
|
| 121 | public function findAllWhere($where, $value) |
|
| 122 | { |
|
| 123 | $this->checkDb(); |
|
| 124 | $params = is_array($value) ? $value : [$value]; |
|
| 125 | return $this->db->connect() |
|
| 126 | ->select() |
|
| 127 | ->from($this->tableName) |
|
| 128 | ->where($where) |
|
| 129 | ->execute($params) |
|
| 130 | ->fetchAllClass(get_class($this)); |
|
| 131 | } |
|
| 132 | ||
| 133 | ||
| 134 | ||
| @@ 268-279 (lines=12) @@ | ||
| 265 | * |
|
| 266 | * @return void |
|
| 267 | */ |
|
| 268 | public function deleteWhere($where, $value) |
|
| 269 | { |
|
| 270 | $this->checkDb(); |
|
| 271 | $params = is_array($value) ? $value : [$value]; |
|
| 272 | ||
| 273 | $this->db->connect() |
|
| 274 | ->deleteFrom($this->tableName) |
|
| 275 | ->where($where) |
|
| 276 | ->execute($params); |
|
| 277 | ||
| 278 | $this->id = null; |
|
| 279 | } |
|
| 280 | } |
|
| 281 | ||