mediatekformation

PositiveOrZero extends GreaterThanOrEqual
in package
Uses NumberConstraintTrait

Used for the comparison of values.

Tags
Annotation
Target

({"PROPERTY", "METHOD", "ANNOTATION"})

author

Jan Schädlich jan.schaedlich@sensiolabs.de

Table of Contents

CLASS_CONSTRAINT  = 'class'
Marks a constraint that can be put onto classes.
DEFAULT_GROUP  = 'Default'
The name of the group given to all constraints with no explicit group.
PROPERTY_CONSTRAINT  = 'property'
Marks a constraint that can be put onto properties.
TOO_LOW_ERROR  = 'ea4e51d1-3342-48bd-87f1-9e672cd90cad'
$groups  : array<string|int, string>
The groups that the constraint belongs to.
$message  : mixed
$payload  : mixed
Domain-specific data attached to a constraint.
$propertyPath  : mixed
$value  : mixed
$errorNames  : mixed
Maps error codes to the names of their constants.
__construct()  : mixed
__isset()  : bool
__set()  : mixed
Sets the value of a lazily initialized option.
addImplicitGroupName()  : mixed
Adds the given group if this constraint is in the Default group.
getDefaultOption()  : string|null
Returns the name of the default option.
getErrorName()  : string
Returns the name of the given error code.
getRequiredOptions()  : array<string|int, string>
Returns the name of the required options.
getTargets()  : string|array<string|int, string>
Returns whether the constraint can be put onto classes, properties or both.
validatedBy()  : string
configureNumberConstraintOptions()  : array<string|int, mixed>

Constants

CLASS_CONSTRAINT

Marks a constraint that can be put onto classes.

public mixed CLASS_CONSTRAINT = 'class'

DEFAULT_GROUP

The name of the group given to all constraints with no explicit group.

public mixed DEFAULT_GROUP = 'Default'

PROPERTY_CONSTRAINT

Marks a constraint that can be put onto properties.

public mixed PROPERTY_CONSTRAINT = 'property'

TOO_LOW_ERROR

public mixed TOO_LOW_ERROR = 'ea4e51d1-3342-48bd-87f1-9e672cd90cad'

Properties

$groups

The groups that the constraint belongs to.

public array<string|int, string> $groups

$message

public mixed $message = 'This value should be either positive or zero.'

$payload

Domain-specific data attached to a constraint.

public mixed $payload

$errorNames

Maps error codes to the names of their constants.

protected static mixed $errorNames = []

Methods

__construct()

public __construct([mixed $options = null ]) : mixed
Parameters
$options : mixed = null
Return values
mixed —

__isset()

public __isset(string $option) : bool
Parameters
$option : string

The option name

Return values
bool —

__set()

Sets the value of a lazily initialized option.

public __set(string $option, mixed $value) : mixed

Corresponding properties are added to the object on first access. Hence this method will be called at most once per constraint instance and option name.

Parameters
$option : string

The option name

$value : mixed

The value to set

Tags
throws
InvalidOptionsException

If an invalid option name is given

Return values
mixed —

addImplicitGroupName()

Adds the given group if this constraint is in the Default group.

public addImplicitGroupName(string $group) : mixed
Parameters
$group : string
Return values
mixed —

getDefaultOption()

Returns the name of the default option.

public getDefaultOption() : string|null

Override this method to define a default option.

Tags
see
__construct()
Return values
string|null —

getErrorName()

Returns the name of the given error code.

public static getErrorName(string $errorCode) : string
Parameters
$errorCode : string

The error code

Tags
throws
InvalidArgumentException

If the error code does not exist

Return values
string —

The name of the error code

getRequiredOptions()

Returns the name of the required options.

public getRequiredOptions() : array<string|int, string>

Override this method if you want to define required options.

Tags
see
__construct()
Return values
array<string|int, string> —

getTargets()

Returns whether the constraint can be put onto classes, properties or both.

public getTargets() : string|array<string|int, string>

This method should return one or more of the constants Constraint::CLASS_CONSTRAINT and Constraint::PROPERTY_CONSTRAINT.

Return values
string|array<string|int, string> —

One or more constant values

validatedBy()

public validatedBy() : string
Return values
string —

configureNumberConstraintOptions()

private configureNumberConstraintOptions(mixed $options) : array<string|int, mixed>
Parameters
$options : mixed
Return values
array<string|int, mixed> —

Search results