| @@ 308-321 (lines=14) @@ | ||
| 305 | * model's ID, while null values are ignored. |
|
| 306 | * @return static |
|
| 307 | */ |
|
| 308 | public function is($number) |
|
| 309 | { |
|
| 310 | if ($number === null) { |
|
| 311 | return $this; |
|
| 312 | } |
|
| 313 | ||
| 314 | if ($number instanceof Model) { |
|
| 315 | $number = $number->getId(); |
|
| 316 | } |
|
| 317 | ||
| 318 | $this->addColumnCondition("= ?", $number); |
|
| 319 | ||
| 320 | return $this; |
|
| 321 | } |
|
| 322 | ||
| 323 | /** |
|
| 324 | * Request that a column equals one of some strings |
|
| @@ 362-372 (lines=11) @@ | ||
| 359 | * @param Model|int $model The ID or model you don't want to get |
|
| 360 | * @return static |
|
| 361 | */ |
|
| 362 | public function except($model) |
|
| 363 | { |
|
| 364 | if ($model instanceof Model) { |
|
| 365 | $model = $model->getId(); |
|
| 366 | } |
|
| 367 | ||
| 368 | $this->where('id'); |
|
| 369 | $this->addColumnCondition("!= ?", $model); |
|
| 370 | ||
| 371 | return $this; |
|
| 372 | } |
|
| 373 | ||
| 374 | /** |
|
| 375 | * Return the results sorted by the value of a column |
|