| @@ 268-281 (lines=14) @@ | ||
| 265 | * model's ID, while null values are ignored. |
|
| 266 | * @return self |
|
| 267 | */ |
|
| 268 | public function is($number) |
|
| 269 | { |
|
| 270 | if ($number === null) { |
|
| 271 | return $this; |
|
| 272 | } |
|
| 273 | ||
| 274 | if ($number instanceof Model) { |
|
| 275 | $number = $number->getId(); |
|
| 276 | } |
|
| 277 | ||
| 278 | $this->addColumnCondition("= ?", $number); |
|
| 279 | ||
| 280 | return $this; |
|
| 281 | } |
|
| 282 | ||
| 283 | /** |
|
| 284 | * Request that a column equals one of some strings |
|
| @@ 322-332 (lines=11) @@ | ||
| 319 | * @param Model|int $model The ID or model you don't want to get |
|
| 320 | * @return self |
|
| 321 | */ |
|
| 322 | public function except($model) |
|
| 323 | { |
|
| 324 | if ($model instanceof Model) { |
|
| 325 | $model = $model->getId(); |
|
| 326 | } |
|
| 327 | ||
| 328 | $this->where('id'); |
|
| 329 | $this->addColumnCondition("!= ?", $model); |
|
| 330 | ||
| 331 | return $this; |
|
| 332 | } |
|
| 333 | ||
| 334 | /** |
|
| 335 | * Return the results sorted by the value of a column |
|