-
Notifications
You must be signed in to change notification settings - Fork 1
Is Null Or Not
Gilberto Junior edited this page Nov 29, 2019
·
3 revisions
A operator that represents the field's value is null.
public function isNull(string $column): self;
public function null(string $column): self;
PHP's way:
$repository->isNull('deleted_at');
SQL's Representation:
WHERE deleted_at IS NULL;
PHP's way:
$repository->null('canceled_at');
SQL's Representation:
WHERE canceled_at IS NULL;
PHP's way:
$repository->isNull('email')
->orIsNull('status');
SQL's Representation:
WHERE email IS NULL OR status IS NULL;
PHP's way:
$repository->null('created_at')
->orNull('user_id');
SQL's Representation:
WHERE created_at IS NULL OR user_id IS NULL;
A operator that represents field's value is not null.
public function isNotNull(string $column): self;
public function notNull(string $column): self;
PHP's way:
$repository->isNotNull('name');
SQL's Representation:
WHERE name IS NOT NULL;
PHP's way:
$repository->notNull('paid_at');
SQL's Representation:
WHERE paid_at IS NOT NULL;
PHP's way:
$repository->isNotNull('delivery_at')
->orIsNotNull('email');
SQL's Representation:
WHERE delivery_at IS NOT NULL OR email IS NOT NULL;
PHP's way:
$repository->notNull('address')
->orNotNull('city');
SQL's Representation:
WHERE address IS NOT NULL OR city IS NOT NULL;
by c0dehappy