whereIsNot() and orWhereIsNot()
The whereIsNot()
method adds a WHERE column != value
condition with strict validation.
It is a semantic and more readable alternative to where($column, '!=', $value)
, especially useful for excluding exact matches.
Signature:
public function whereIsNot(string $column, mixed $value): self
public function orWhereIsNot(string $column, mixed $value): self
Basic Usage
Exclude a specific value from the result set:
$db->whereIsNot('role', 'admin');
$users = $db->get('users');
With numeric values:
$db->whereIsNot('id', 1);
$item = $db->getOne('products');
Column Validation
The column name must be alphanumeric and may include dots (e.g. user.status
). Any invalid field name triggers an InvalidArgumentException
.
orWhereIsNot()
This method behaves the same as whereIsNot()
, but adds the condition using OR
instead of AND
.