FullTransformer deprecated

class FullTransformer extends FullTransformer

deprecated

since version 2.3, to be removed in 3.0. Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\FullTransformer} instead.

Alias of {@link \Symfony\Component\Intl\DateFormatter\DateFormat\FullTransformer}.

Methods

__construct(string $pattern, string $timezone)

Constructor.

from FullTransformer
Transformer[] getTransformers()

Return the array of Transformer objects.

from FullTransformer
string format(DateTime $dateTime)

Format a DateTime using ICU dateformat pattern.

from FullTransformer
string formatReplace(string $dateChars, DateTime $dateTime)

Return the formatted ICU value for the matched date characters.

from FullTransformer
int parse(DateTime $dateTime, string $value)

Parse a pattern based string to a timestamp value.

from FullTransformer
string getReverseMatchingRegExp(string $pattern)

Retrieve a regular expression to match with a formatted value.

from FullTransformer
bool isQuoteMatch(string $quoteMatch)

Check if the first char of a string is a single quote.

from FullTransformer
string replaceQuoteMatch(string $quoteMatch)

Replaces single quotes at the start or end of a string with two single quotes.

from FullTransformer

Details

__construct(string $pattern, string $timezone)

Constructor.

Parameters

string $pattern The pattern to be used to format and/or parse values
string $timezone The timezone to perform the date/time calculations

Transformer[] getTransformers()

Return the array of Transformer objects.

Return Value

Transformer[] Associative array of Transformer objects (format char => Transformer)

string format(DateTime $dateTime)

Format a DateTime using ICU dateformat pattern.

Parameters

DateTime $dateTime A DateTime object to be used to generate the formatted value

Return Value

string The formatted value

string formatReplace(string $dateChars, DateTime $dateTime)

Return the formatted ICU value for the matched date characters.

Parameters

string $dateChars The date characters to be replaced with a formatted ICU value
DateTime $dateTime A DateTime object to be used to generate the formatted value

Return Value

string The formatted value

Exceptions

NotImplementedException When it encounters a not implemented date character

int parse(DateTime $dateTime, string $value)

Parse a pattern based string to a timestamp value.

Parameters

DateTime $dateTime A configured DateTime object to use to perform the date calculation
string $value String to convert to a time value

Return Value

int The corresponding Unix timestamp

Exceptions

InvalidArgumentException When the value can not be matched with pattern

string getReverseMatchingRegExp(string $pattern)

Retrieve a regular expression to match with a formatted value.

Parameters

string $pattern The pattern to create the reverse matching regular expression

Return Value

string The reverse matching regular expression with named captures being formed by the transformer index in the $transformer array

bool isQuoteMatch(string $quoteMatch)

Check if the first char of a string is a single quote.

Parameters

string $quoteMatch The string to check

Return Value

bool true if matches, false otherwise

string replaceQuoteMatch(string $quoteMatch)

Replaces single quotes at the start or end of a string with two single quotes.

Parameters

string $quoteMatch The string to replace the quotes

Return Value

string A string with the single quotes replaced

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.html