Transformation

in package

Class representing a single Transformation.

Properties

private$writer  : string                

private$artifact  : string                

private$source  : string                

private$query  : string                

private$transformer  : \phpDocumentor\Transformer\Transformer                

private$parameters  : \phpDocumentor\Transformer\Template\Parameter[]                

private$template  : \phpDocumentor\Transformer\Template                

Methods

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)

Returns

mixed

Sets the query.

publicsetQuery(string $query) : void

Parameters

$query : string

Free-form string with writer-specific values.

Returns the set query.

publicgetQuery() : string

Returns

string

Sets the writer type and instantiates a writer.

publicsetWriter(string $writer) : void

Parameters

$writer : string

Name of writer to instantiate.

Returns the class name of the associated writer.

publicgetWriter() : string

Returns

string

Sets the source / type which the writer will use to generate artifacts from.

publicsetSource(string $source) : void

Parameters

$source : string

Free-form string with writer-specific meaning.

Returns the name of the source / type used in the transformation process.

publicgetSource() : string

Returns

string

publictemplate() : Template

Returns

Template

Filename of the resulting artifact relative to the root.

publicsetArtifact(string $artifact) : void

If the query results in a set of artifacts (multiple nodes / array); then this string must contain an identifying variable as returned by the writer.

Parameters

$artifact : string

Name of artifact to generate; usually a filepath.

Returns the name of the artifact.

publicgetArtifact() : string

Returns

string

Sets an array of parameters (key => value).

publicsetParameters(\phpDocumentor\Transformer\Template\Parameter[] $parameters) : void

Parameters

$parameters : \phpDocumentor\Transformer\Template\Parameter[]

Associative multidimensional array containing parameters for the Writer.

Returns all parameters for this transformation.

publicgetParameters() : \phpDocumentor\Transformer\Template\Parameter[]

Returns

\phpDocumentor\Transformer\Template\Parameter[]

Returns a specific parameter, or $default if none exists.

publicgetParameter(string $name) : Parameter|null

Parameters

$name : string

Name of the parameter to return.

Returns

Parameter|null

Returns a specific parameter, or $default if none exists.

publicgetParametersWithKey(string $name) : \phpDocumentor\Transformer\Template\Parameter[]

Parameters

$name : string

Name of the parameter to return.

Returns

\phpDocumentor\Transformer\Template\Parameter[]

Sets the transformer on this transformation.

publicsetTransformer(Transformer $transformer) : void

Parameters

$transformer : Transformer

Returns the transformer for this transformation.

publicgetTransformer() : Transformer|null

Returns

Transformer|null