Documentation

ReflectionParameterTransformer
in package

This class allows different components to reuse the logic the database has to create parameters for different functions/methods.

The transformer receives:

  • A reflection of a function or method that may contain parameters expecting a subtype of model
  • A list of parameters that we provide for this function that may contain ID for a db record

The transformer then returns:

  • The parameters, replacing those that were incompatible with their expected model type with a looked up version

NOTE: This sorts the parameters by the order they are expected in within the parameters, but keys them according to the names of the parameters. For example:

Table of Contents

transformParameters()  : mixed

Methods

transformParameters()

public static transformParameters(ReflectionFunctionAbstract $reflection, array<string|int, mixed> $parameters) : mixed
Parameters
$reflection : ReflectionFunctionAbstract
$parameters : array<string|int, mixed>
Return values
mixed

Search results