| @@ 123-133 (lines=11) @@ | ||
| 120 | * |
|
| 121 | * @return this |
|
| 122 | */ |
|
| 123 | public function findWhere($where, $value) |
|
| 124 | { |
|
| 125 | $this->checkDb(); |
|
| 126 | $params = is_array($value) ? $value : [$value]; |
|
| 127 | return $this->db->connect() |
|
| 128 | ->select() |
|
| 129 | ->from($this->tableName) |
|
| 130 | ->where($where) |
|
| 131 | ->execute($params) |
|
| 132 | ->fetchInto($this); |
|
| 133 | } |
|
| 134 | ||
| 135 | ||
| 136 | ||
| @@ 194-204 (lines=11) @@ | ||
| 191 | * |
|
| 192 | * @return array of object of this class |
|
| 193 | */ |
|
| 194 | public function findAllWhere($where, $value) |
|
| 195 | { |
|
| 196 | $this->checkDb(); |
|
| 197 | $params = is_array($value) ? $value : [$value]; |
|
| 198 | return $this->db->connect() |
|
| 199 | ->select() |
|
| 200 | ->from($this->tableName) |
|
| 201 | ->where($where) |
|
| 202 | ->execute($params) |
|
| 203 | ->fetchAllClass(get_class($this)); |
|
| 204 | } |
|
| 205 | ||
| 206 | ||
| 207 | /** |
|