CallbackTransformer

class CallbackTransformer implements DataTransformerInterface Methods __construct(callable $transform, callable $reverseTransform) Constructor. mixed transform(mixed $data) Transforms a value from the original representation to a transformed representation. mixed reverseTransform(mixed $data) Transforms a value from the transformed representation to its original representation. Details __construct(callable $transform, callable $reverseTransform)

Callback::getTargets()

string|array getTargets() Returns whether the constraint can be put onto classes, properties or both. This method should return one or more of the constants Constraint::CLASSCONSTRAINT and Constraint::PROPERTYCONSTRAINT. Return Value string|array One or more constant values

Callback::getDefaultOption()

string getDefaultOption() Returns the name of the default option. Override this method to define a default option. Return Value string

Callback

class Callback extends Constraint Constants DEFAULT_GROUP The name of the group given to all constraints with no explicit group. CLASS_CONSTRAINT Marks a constraint that can be put onto classes. PROPERTY_CONSTRAINT Marks a constraint that can be put onto properties. Properties mixed $payload Domain-specific data attached to a constraint. from Constraint array $groups The groups that the constraint belongs to from Constraint string|callable $callback Methods static string

CachingFactoryDecorator::getDecoratedFactory()

ChoiceListFactoryInterface getDecoratedFactory() Returns the decorated factory. Return Value ChoiceListFactoryInterface The decorated factory

CachingFactoryDecorator::generateHash()

static string generateHash(mixed $value, string $namespace = '') Generates a SHA-256 hash for the given value. Optionally, a namespace string can be passed. Calling this method will the same values, but different namespaces, will return different hashes. Parameters mixed $value The value to hash string $namespace Optional. The namespace Return Value string The SHA-256 hash

CachingFactoryDecorator::createView()

ChoiceListView createView(ChoiceListInterface $list, null|array|callable $preferredChoices = null, null|callable $label = null, null|callable $index = null, null|callable $groupBy = null, null|array|callable $attr = null) Creates a view for the given choice list. Callables may be passed for all optional arguments. The callables receive the choice as first and the array key as the second argument. The callable for the label and the name should return the generated label/choice na

CachingFactoryDecorator::createListFromLoader()

ChoiceListInterface createListFromLoader(ChoiceLoaderInterface $loader, null|callable $value = null) Creates a choice list that is loaded with the given loader. Optionally, a callable can be passed for generating the choice values. The callable receives the choice as first and the array key as the second argument. Parameters ChoiceLoaderInterface $loader The choice loader null|callable $value The callable generating the choice values Return Value ChoiceListInterface The choice

CachingFactoryDecorator::createListFromChoices()

ChoiceListInterface createListFromChoices(array|Traversable $choices, null|callable $value = null) Creates a choice list for the given choices. The choices should be passed in the values of the choices array. Optionally, a callable can be passed for generating the choice values. The callable receives the choice as first and the array key as the second argument. Parameters array|Traversable $choices The choices null|callable $value The callable generating the choice values Ret

CachingFactoryDecorator

class CachingFactoryDecorator implements ChoiceListFactoryInterface Caches the choice lists created by the decorated factory. Methods static string generateHash(mixed $value, string $namespace = '') Generates a SHA-256 hash for the given value. __construct(ChoiceListFactoryInterface $decoratedFactory) Decorates the given factory. ChoiceListFactoryInterface getDecoratedFactory() Returns the decorated factory. ChoiceListInterface createListFromChoices(array|Traversable $choi