The Action Domain Responder requires a data transfer mechanism between the three layers to serve your application. The Phalcon\Domain\Payload is a data transfer object that is used to send data between the three layers of the pattern.
When using this object, you can set its status, the input, the output, any messages or extra information required by each layer of your pattern to be transferred to the next layer that requires it during the application flow. The class itself is a data wrapper that contains the necessary information to be passed between layers.
The properties stored are:
extras: Extra information
The component offers getters and setters for the above properties.
All the setters return back a Phalcon\Domain\Payload object, which allows you to chain calls for a more fluent syntax.
There are three interfaces that you can take advantage of if you wish to extend the object.
ReadableInterface: contains only read methods
WritableInterface: contains only write methods
PayloadInterface: contains both read and write methods
The Phalcon\Domain\Payload\Status class contains several constants to help with the domain status of your Payload objects. You can always extend the class and introduce your own domain statuses, depending on the needs of your application.
These statuses can be used at the display/view layer of your application to process domain objects retrieved via Payload::getOutput().