NullableIntField

Class. It extends IntField.

use Saij\WpAppFramework\Query\Field\NullableIntField;

A nullable int column of a table (?int). notEquals() and notIn() also match rows whose column is null, like null !== $value in PHP.

Constructor

new NullableIntField(string $class, string $field)
ParameterTypeDefaultDescription
classclass-stringrequiredThe class the field belongs to: a meta class (#[PostMeta]) or row class (#[Table]).
fieldstringrequiredThe name of the constructor parameter.

Methods

between()

between(int $min, int $max): Condition

Matches values from $min to $max, both included.

ParameterTypeDefaultDescription
minintrequiredThe lowest value.
maxintrequiredThe highest value.

Returns Condition

equals()

equals(int $value): Condition

Matches values equal to $value.

ParameterTypeDefaultDescription
valueintrequiredThe value to compare with.

Returns Condition

getClass()

getClass(): string

The class the field belongs to.

Returns class-string

getField()

getField(): string

The name of the field: the name of the constructor parameter.

Returns string

greaterOrEqual()

greaterOrEqual(int $value): Condition

Matches values greater than or equal to $value.

ParameterTypeDefaultDescription
valueintrequiredThe value to compare with.

Returns Condition

greaterThan()

greaterThan(int $value): Condition

Matches values greater than $value.

ParameterTypeDefaultDescription
valueintrequiredThe value to compare with.

Returns Condition

in()

in(int ...$values): Condition

Matches values equal to one of $values. Throws an InvalidArgumentException if no value is given.

ParameterTypeDefaultDescription
...valuesintThe values to compare with.

Returns Condition

isNotNull()

isNotNull(): Condition

Rows whose column is not null.

Returns Condition

isNull()

isNull(): Condition

Rows whose column is null.

Returns Condition

lessOrEqual()

lessOrEqual(int $value): Condition

Matches values less than or equal to $value.

ParameterTypeDefaultDescription
valueintrequiredThe value to compare with.

Returns Condition

lessThan()

lessThan(int $value): Condition

Matches values less than $value.

ParameterTypeDefaultDescription
valueintrequiredThe value to compare with.

Returns Condition

notEquals()

notEquals(int $value): Condition

Matches values not equal to $value. On a nullable column, rows whose column is null match as well.

ParameterTypeDefaultDescription
valueintrequiredThe value to compare with.

Returns Condition

notIn()

notIn(int ...$values): Condition

Matches values equal to none of $values. On a nullable column, rows whose column is null match as well. Throws an InvalidArgumentException if no value is given.

ParameterTypeDefaultDescription
...valuesintThe values to compare with.

Returns Condition