class TimeFieldValidator extends DateFieldValidator (View source)

Validates that a value is a valid time, which means that it follows the equivalent formats:

  • PHP date format H:i:s
  • ISO format 'HH:mm:ss' i.e. DBTime::ISO_TIME

Blank string values are allowed

Properties

protected string $name

The name of the field being validated

from  FieldValidator
protected mixed $value

The value to validate

from  FieldValidator
protected bool $allowNull

Whether null is considered a valid value

from  FieldValidator

Methods

public
__construct(string $name, mixed $value, string|null $minValue = null, string|null $maxValue = null, callable|null $converter = null)

No description

public
validate()

Validate the value

protected
validateValue()

Inner validation method that performs the actual validation logic

protected
string
getFormat()

No description

protected
string
getMessage()

No description

Details

__construct(string $name, mixed $value, string|null $minValue = null, string|null $maxValue = null, callable|null $converter = null)

No description

Parameters

string $name
mixed $value
string|null $minValue
string|null $maxValue
callable|null $converter

ValidationResult validate()

Validate the value

Return Value

ValidationResult

protected ValidationResult validateValue()

Inner validation method that performs the actual validation logic

Return Value

ValidationResult

protected string getFormat()

No description

Return Value

string

protected string getMessage()

No description

Return Value

string