DS::Transformer - receives, transforms and passes on rows
This class is the base class of all transformers in DS. If you need to write a transformer, first consider if DS::Transformer::Sub will do. It supports any kind of row-wise transformations where there is a one-to-one correspondence between incoming and outgoing rows.
Method for processing of ingoing data.
This method is supposed to be overridden.
By default it will return
Instantiates an object of class
taking the type
returning the type
attached to the source
$source and attaced to the target
any of the parameters can be left out.
$target to this object.
This method also triggers type checking,
ensuring that the outgoing type of this object is sufficient for
If the type check fails,
an exception is thrown.
This is a method mostly for internal use. It will get or set the target, bypassing type checks.
Calling this metod will cause the transformer to pass
$row to the target
This is an accessor that gets or sets the outgoing type of this object.
Triggers processing of
This method calls
and then passes the result to
$source as source.
This method also validates data types by calling
throwing an exception if the validation fails.
Accessor for source. This method sets the source of this object and triggers type checking.
Validates source type.
$source_type is not valid,
it returns false,
this method ensures that the ingoing type of this object contains no fields not specified in
Override if you need more complex checking.
Accessor for ingoing type.
Written by Michael Zedeler.