This documentation describes unreleased changes on the main branch.

FloatField

Class. It extends Field.

use Saij\WpAppFramework\Query\Field\FloatField;

A float field of a meta class or a column of a table.

Constructor

new FloatField(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(float $min, float $max): Condition

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

ParameterTypeDefaultDescription
minfloatrequiredThe lowest value; on a table column, a finite number.
maxfloatrequiredThe highest value; on a table column, a finite number.

Returns Condition

equals()

equals(float $value): Condition

Matches values equal to $value.

ParameterTypeDefaultDescription
valuefloatrequiredThe value to compare with; on a table column, a finite number.

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(float $value): Condition

Matches values greater than or equal to $value.

ParameterTypeDefaultDescription
valuefloatrequiredThe value to compare with; on a table column, a finite number.

Returns Condition

greaterThan()

greaterThan(float $value): Condition

Matches values greater than $value.

ParameterTypeDefaultDescription
valuefloatrequiredThe value to compare with; on a table column, a finite number.

Returns Condition

in()

in(float ...$values): Condition

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

ParameterTypeDefaultDescription
...valuesfloatThe values to compare with; on a table column, finite numbers.

Returns Condition

lessOrEqual()

lessOrEqual(float $value): Condition

Matches values less than or equal to $value.

ParameterTypeDefaultDescription
valuefloatrequiredThe value to compare with; on a table column, a finite number.

Returns Condition

lessThan()

lessThan(float $value): Condition

Matches values less than $value.

ParameterTypeDefaultDescription
valuefloatrequiredThe value to compare with; on a table column, a finite number.

Returns Condition

notEquals()

notEquals(float $value): Condition

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

ParameterTypeDefaultDescription
valuefloatrequiredThe value to compare with; on a table column, a finite number.

Returns Condition

notIn()

notIn(float ...$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
...valuesfloatThe values to compare with; on a table column, finite numbers.

Returns Condition