| @@ 339-352 (lines=14) @@ | ||
| 336 | * model's ID, while null values are ignored. |
|
| 337 | * @return static |
|
| 338 | */ |
|
| 339 | public function is($number) |
|
| 340 | { |
|
| 341 | if ($number === null) { |
|
| 342 | return $this; |
|
| 343 | } |
|
| 344 | ||
| 345 | if ($number instanceof Model) { |
|
| 346 | $number = $number->getId(); |
|
| 347 | } |
|
| 348 | ||
| 349 | $this->addColumnCondition("= ?", $number); |
|
| 350 | ||
| 351 | return $this; |
|
| 352 | } |
|
| 353 | ||
| 354 | public function isLike($string) |
|
| 355 | { |
|
| @@ 404-414 (lines=11) @@ | ||
| 401 | * @param Model|int $model The ID or model you don't want to get |
|
| 402 | * @return static |
|
| 403 | */ |
|
| 404 | public function except($model) |
|
| 405 | { |
|
| 406 | if ($model instanceof Model) { |
|
| 407 | $model = $model->getId(); |
|
| 408 | } |
|
| 409 | ||
| 410 | $this->where('id'); |
|
| 411 | $this->addColumnCondition("!= ?", $model); |
|
| 412 | ||
| 413 | return $this; |
|
| 414 | } |
|
| 415 | ||
| 416 | /** |
|
| 417 | * Return the results sorted by the value of a column |
|