Transformation
in package
Class representing a single Transformation.
Table of Contents
- $artifact : string
- $parameters : array<string|int, Parameter>
- $query : string
- $source : string
- $template : Template
- $transformer : Transformer
- $writer : string
- __construct() : mixed
- Constructs a new Transformation object and populates the required parameters.
- getArtifact() : string
- Returns the name of the artifact.
- getParameter() : Parameter|null
- Returns a specific parameter, or $default if none exists.
- getParameters() : array<string|int, Parameter>
- Returns all parameters for this transformation.
- getParametersWithKey() : array<string|int, Parameter>
- Returns a specific parameter, or $default if none exists.
- getQuery() : string
- Returns the set query.
- getSource() : string
- Returns the name of the source / type used in the transformation process.
- getTransformer() : Transformer|null
- Returns the transformer for this transformation.
- getWriter() : string
- Returns the class name of the associated writer.
- setParameters() : void
- Sets an array of parameters (key => value).
- setTransformer() : void
- Sets the transformer on this transformation.
- template() : Template
Properties
$artifact
private
string
$artifact
the location where the output should be sent to; the exact function differs per writer.
$parameters
private
array<string|int, Parameter>
$parameters
= []
A series of parameters that can influence what the writer does; the exact function differs per writer.
$query
private
string
$query
a filter or other form of limitation on what information of the AST is used; the exact function differs per writer.
$source
private
string
$source
the location where input for a writer should come from; the exact function differs per writer.
$template
private
Template
$template
$transformer
private
Transformer
$transformer
The object guiding the transformation process and having meta-data of it.
$writer
private
string
$writer
Reference to an object containing the business logic used to execute this transformation.
Methods
__construct()
Constructs a new Transformation object and populates the required parameters.
public
__construct(Template $template, string $query, string $writer, string $source, string $artifact) : mixed
Parameters
- $template : Template
- $query : string
-
What information to use as datasource for the writer's source.
- $writer : string
-
What type of transformation to apply (PDF, Twig etc).
- $source : string
-
Which template or type of source to use.
- $artifact : string
-
What is the filename of the result (relative to the generated root)
Return values
mixed —getArtifact()
Returns the name of the artifact.
public
getArtifact() : string
Return values
string —getParameter()
Returns a specific parameter, or $default if none exists.
public
getParameter(string $name) : Parameter|null
Parameters
- $name : string
-
Name of the parameter to return.
Return values
Parameter|null —getParameters()
Returns all parameters for this transformation.
public
getParameters() : array<string|int, Parameter>
Return values
array<string|int, Parameter> —getParametersWithKey()
Returns a specific parameter, or $default if none exists.
public
getParametersWithKey(string $name) : array<string|int, Parameter>
Parameters
- $name : string
-
Name of the parameter to return.
Return values
array<string|int, Parameter> —getQuery()
Returns the set query.
public
getQuery() : string
Return values
string —getSource()
Returns the name of the source / type used in the transformation process.
public
getSource() : string
Return values
string —getTransformer()
Returns the transformer for this transformation.
public
getTransformer() : Transformer|null
Return values
Transformer|null —getWriter()
Returns the class name of the associated writer.
public
getWriter() : string
Return values
string —setParameters()
Sets an array of parameters (key => value).
public
setParameters(array<string|int, Parameter> $parameters) : void
Parameters
- $parameters : array<string|int, Parameter>
-
Associative multidimensional array containing parameters for the Writer.
Return values
void —setTransformer()
Sets the transformer on this transformation.
public
setTransformer(Transformer $transformer) : void
Parameters
- $transformer : Transformer
Return values
void —template()
public
template() : Template