See information about the latest product version
@MessageBrokerCopyTransform
Use the @MessageBrokerCopyTransform annotation to alter the behavior of the evaluate method in a PHP class.
The @MessageBrokerCopyTransform annotation causes one parameter to be passed to the evaluate method. This parameter is a reference to the output assembly with the contents of the input assembly already copied into it. The input assembly is available with the @MessageBrokerCopyTransform. If you declare a second parameter (which is optional) the input assembly is passed to it.
If the @MessageBrokerCopy Transform and @MessageBrokerSimpleTransform annotations are specified together, the @MessageBrokerCopyTransform annotation takes precedence.
The following example modifies the original XML message by adding an element called Greeting with the value Hello World:
<?php
class CopyTest {
/**
* An example of MessageBrokerCopyTransform
*
* @MessageBrokerCopyTransform
*/
function evaluate($assembly) {
$assembly->XMLNSC->doc->Greeting = “Hello World”;
}
}
?>