Abstract Class Yiisoft\Validator\Rule\Date\BaseDate
Psalm Types
| Name | Value |
|---|---|
| IntlDateFormatterFormat | \IntlDateFormatter::FULL|\IntlDateFormatter::LONG|\IntlDateFormatter::MEDIUM|\IntlDateFormatter::SHORT|\IntlDateFormatter::NONE |
Public Methods
Method Details
| public mixed __construct ( string|null $format, string|null $timeZone, string|null $locale, integer|string|DateTimeInterface|null $min, integer|string|DateTimeInterface|null $max, string|null $messageFormat, string|null $incorrectInputMessage, string|null $tooEarlyMessage, string|null $tooLateMessage, boolean|callable|null $skipOnEmpty, boolean $skipOnError, Closure|null $when ) | ||
| $format | string|null | |
| $timeZone | string|null | |
| $locale | string|null | |
| $min | integer|string|DateTimeInterface|null | |
| $max | integer|string|DateTimeInterface|null | |
| $messageFormat | string|null | |
| $incorrectInputMessage | string|null | |
| $tooEarlyMessage | string|null | |
| $tooLateMessage | string|null | |
| $skipOnEmpty | boolean|callable|null | |
| $skipOnError | boolean | |
| $when | Closure|null | |
public function __construct(
private ?string $format,
private ?string $timeZone,
private ?string $locale,
private int|string|DateTimeInterface|null $min,
private int|string|DateTimeInterface|null $max,
private ?string $messageFormat,
private ?string $incorrectInputMessage,
private ?string $tooEarlyMessage,
private ?string $tooLateMessage,
bool|callable|null $skipOnEmpty,
private bool $skipOnError,
private ?Closure $when,
) {
$this->skipOnEmpty = $skipOnEmpty;
}
Defined in: Yiisoft\Validator\RuleInterface::getHandler()
A matching handler name or an instance used for processing this rule.
While not required, for naming of handlers' classes it's recommended to use a rule class name with "Handler"
suffix, so for FilledAtLeast rule class name the handler class name will be FilledAtLeastHandler and so on.
All packages handlers are stored within the same namespace as rules, but this is not a strict requirement.
| public abstract Yiisoft\Validator\RuleHandlerInterface|string getHandler ( ) | ||
| return | Yiisoft\Validator\RuleHandlerInterface|string |
A rule handler name (for example |
|---|---|---|
public function getHandler(): string|RuleHandlerInterface;
| public string|null getIncorrectInputMessage ( ) |
public function getIncorrectInputMessage(): ?string
{
return $this->incorrectInputMessage;
}
| public DateTimeInterface|integer|string|null getMax ( ) |
public function getMax(): DateTimeInterface|int|string|null
{
return $this->max;
}
| public string|null getMessageFormat ( ) |
public function getMessageFormat(): ?string
{
return $this->messageFormat;
}
| public DateTimeInterface|integer|string|null getMin ( ) |
public function getMin(): DateTimeInterface|int|string|null
{
return $this->min;
}
Defined in: Yiisoft\Validator\Rule\Trait\SkipOnEmptyTrait::getSkipOnEmpty()
A getter for $skipOnEmpty property.
| public boolean|callable|null getSkipOnEmpty ( ) | ||
| return | boolean|callable|null |
A current raw (non-normalized) value. |
|---|---|---|
public function getSkipOnEmpty(): bool|callable|null
{
return $this->skipOnEmpty;
}
| public non-empty-string|null getTimeZone ( ) |
public function getTimeZone(): ?string
{
return $this->timeZone;
}
| public string|null getTooEarlyMessage ( ) |
public function getTooEarlyMessage(): ?string
{
return $this->tooEarlyMessage;
}
| public string|null getTooLateMessage ( ) |
public function getTooLateMessage(): ?string
{
return $this->tooLateMessage;
}
Defined in: Yiisoft\Validator\Rule\Trait\WhenTrait::getWhen()
A getter for $when property.
| public Closure|null getWhen ( ) | ||
| return | Closure|null |
Current value:
|
|---|---|---|
public function getWhen(): ?Closure
{
return $this->when;
}
Defined in: Yiisoft\Validator\Rule\Trait\SkipOnErrorTrait::shouldSkipOnError()
A getter for $skipOnError property.
| public boolean shouldSkipOnError ( ) | ||
| return | boolean |
Current value. |
|---|---|---|
public function shouldSkipOnError(): bool
{
return $this->skipOnError;
}
Defined in: Yiisoft\Validator\Rule\Trait\SkipOnEmptyTrait::skipOnEmpty()
An immutable setter to change $skipOnEmpty property.
| public $this skipOnEmpty ( boolean|callable|null $value ) | ||
| $value | boolean|callable|null |
A new value. |
| return | $this |
The new instance with a changed value. |
|---|---|---|
public function skipOnEmpty(bool|callable|null $value): static
{
$new = clone $this;
$new->skipOnEmpty = $value;
return $new;
}
Defined in: Yiisoft\Validator\Rule\Trait\SkipOnErrorTrait::skipOnError()
An immutable setter to change $skipOnError property.
| public $this skipOnError ( boolean $value ) | ||
| $value | boolean |
A new value. |
| return | $this |
The new instance with a changed value. |
|---|---|---|
public function skipOnError(bool $value): static
{
$new = clone $this;
$new->skipOnError = $value;
return $new;
}
Defined in: Yiisoft\Validator\Rule\Trait\WhenTrait::when()
An immutable setter to change $when property.
| public $this when ( Closure|null $value ) | ||
| $value | Closure|null |
A new value:
|
| return | $this |
The new instance with a changed value. |
|---|---|---|
public function when(?Closure $value): static
{
$new = clone $this;
$new->when = $value;
return $new;
}
Signup or Login in order to comment.