A validator which will not validate Aggregates that are lazy loaded and uninitialized.
Validation over Aggregate Boundaries can hence be forced by making the relation to
other Aggregate Roots eager loaded.

Note that this validator is not part of the public API and you should not use it manually.

Checks if the given value is valid according to the validator, and returns
the Error Messages object which occurred. Will skip validation if value is
an uninitialized lazy loading proxy.

latestDate and earliestDate may be each <time>, <start>/<duration> or <duration>/<end>, where <duration> is an
ISO 8601 duration and <start> or <end> or <time> may be ‘now’ or a PHP supported format. (1)

In general, you are able to provide a timestamp or a timestamp with additional calculation. Calculations are done
as described in ISO 8601 (2), with an introducing “P”. P7MT2H30M for example mean a period of 7 months, 2 hours
and 30 minutes (P introduces a period at all, while a following T introduces the time-section of a period. This
is not at least in order not to confuse months and minutes, both represented as M).
A period is separated from the timestamp with a forward slash “/”. If the period follows the timestamp, that
period is added to the timestamp; if the period precedes the timestamp, it’s subtracted.
The timestamp can be one of PHP’s supported date formats (1), so also “now” is supported.

Use cases:

If you offer something that has to be manufactured and you ask for a delivery date, you might assure that this
date is at least two weeks in advance; this could be done with the expression “now/P2W”.
If you have a library of ancient goods and want to track a production date that is at least 5 years ago, you can
express it with “P5Y/now”.

Examples:

If you want to test if a given date is at least five minutes ahead, use

earliestDate: now/PT5M

If you want to test if a given date was at least 10 days ago, use

latestDate: P10D/now

If you want to test if a given date is between two fix boundaries, just combine the latestDate and earliestDate-options:

Labels usually allow all kinds of letters, numbers, punctuation marks and
the space character. What you don’t want in labels though are tabs, new
line characters or HTML tags. This validator is for such uses.

The given value is valid if it matches the regular expression specified in PATTERN_VALIDCHARACTERS.

Be aware that the value of this check entirely depends on the output context.
The validated text is not expected to be secure in every circumstance, if you
want to be sure of that, use a customized regular expression or filter on output.