TimeZoneTransformer

class TimeZoneTransformer extends Transformer Parser and formatter for time zone format. Methods string format(DateTime $dateTime, int $length) Format a value using a configured DateTime as date/time source. string getReverseMatchingRegExp(int $length) Returns a reverse matching regular expression of a string generated by format(). array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching

TimeZoneTransformer::extractDateOptions()

array extractDateOptions(string $matched, int $length) Extract date options from a matched value returned by the processing of the reverse matching regular expression. Parameters string $matched The matched value int $length The length of the Transformer pattern string Return Value array An associative array

TimeZoneTransformer deprecated

class TimeZoneTransformer extends TimeZoneTransformer deprecated since version 2.3, to be removed in 3.0. Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\TimeZoneTransformer} instead. Alias of {@link \Symfony\Component\Intl\DateFormatter\DateFormat\TimeZoneTransformer}. Methods string format(DateTime $dateTime, int $length) Format a value using a configured DateTime as date/time source. from TimeZoneTransformer string getReverseMatchingRegExp(int $length) Returns a re

TimeZoneTransformer::format()

string format(DateTime $dateTime, int $length) Format a value using a configured DateTime as date/time source. Parameters DateTime $dateTime A DateTime object to be used to generate the formatted value int $length The formatted value string length Return Value string The formatted value

TimeZoneTransformer::getEtcTimeZoneId()

static string getEtcTimeZoneId(string $formattedTimeZone) Get an Etc/GMT timezone identifier for the specified timezone. The PHP documentation for timezones states to not use the 'Other' time zones because them exists "for backwards compatibility". However all Etc/GMT time zones are in the tz database 'etcetera' file, which indicates they are not deprecated (neither are old names). Only GMT, Etc/Universal, Etc/Zulu, Etc/Greenwich, Etc/GMT-0, Etc/GMT+0 and Etc/GMT0 are

TimeType::getBlockPrefix()

string getBlockPrefix() Returns the prefix of the template block name for this type. The block prefix defaults to the underscored short class name with the "Type" suffix removed (e.g. "UserProfileType" => "user_profile"). Return Value string The prefix of the template block name

TimeValidator::validate()

validate(mixed $value, Constraint $constraint) Checks if the passed value is valid. Parameters mixed $value The value that should be validated Constraint $constraint The constraint for the validation

TimeValidator

class TimeValidator extends ConstraintValidator Constants PRETTY_DATE Whether to format {@link \DateTime} objects as RFC-3339 dates ("Y-m-d H:i:s"). OBJECT_TO_STRING Whether to cast objects with a "__toString()" method to strings. PATTERN Methods initialize(ExecutionContextInterface $context) Initializes the constraint validator. from ConstraintValidator static bool checkTime(int $hour, int $minute, int $second) Checks whether a time is valid. validate(mixed $value, Co

TimeValidator::checkTime()

static bool checkTime(int $hour, int $minute, int $second) Checks whether a time is valid. Parameters int $hour The hour int $minute The minute int $second The second Return Value bool Whether the time is valid

TimeType::buildForm()

buildForm(FormBuilderInterface $builder, array $options) Builds the form. This method is called for each type in the hierarchy starting from the top most type. Type extensions can further modify the form. Parameters FormBuilderInterface $builder The form builder array $options The options