Phalcon domain
NOTE
All classes are prefixed with Phalcon
Domain\Payload\Payload¶
Class Source on GitHub
Holds the payload
Phalcon\Domain\Payload\Payload— implementsPhalcon\Domain\Payload\PayloadInterface
Uses Throwable
Method Summary¶
public Throwable|null getException() Gets the potential exception thrown in the domain layer public mixed getExtras() Extra information public mixed getInput() Input public mixed getMessages() Messages public mixed getOutput() Output public mixed getStatus() Status public PayloadInterface setException( Throwable $exception ) Sets an exception thrown in the domain public PayloadInterface setExtras( mixed $extras ) Sets arbitrary extra domain information. public PayloadInterface setInput( mixed $input ) Sets the domain input. public PayloadInterface setMessages( mixed $messages ) Sets the domain messages. public PayloadInterface setOutput( mixed $output ) Sets the domain output. public PayloadInterface setStatus( mixed $status ) Sets the payload status. Properties¶
protected Throwable|null $exception = null Exception if any protected mixed $extras Extra information protected mixed $input Input protected mixed $messages Messages protected mixed $output Output protected mixed $status Status Methods¶
getException()¶
Gets the potential exception thrown in the domain layer
getExtras()¶
Extra information
getInput()¶
Input
getMessages()¶
Messages
getOutput()¶
Output
getStatus()¶
Status
Status values are drawn from the Status vocabulary.
@see Status
setException()¶
Sets an exception thrown in the domain
setExtras()¶
Sets arbitrary extra domain information.
setInput()¶
Sets the domain input.
setMessages()¶
Sets the domain messages.
setOutput()¶
Sets the domain output.
setStatus()¶
Sets the payload status.
Status values are drawn from the Status vocabulary.
@see Status
Domain\Payload\PayloadFactory¶
Class Source on GitHub
Factory to create payload objects.
It exists so that payload creation can be registered as a service in the DI container and substituted in tests, rather than constructing Payload instances directly.
Phalcon\Domain\Payload\PayloadFactory
Method Summary¶
Methods¶
newInstance()¶
Instantiate a new object
Domain\Payload\PayloadInterface¶
Interface Source on GitHub
This interface is used for consumers
Phalcon\Contracts\Domain\Payload\ReadablePhalcon\Domain\Payload\ReadableInterfacePhalcon\Domain\Payload\PayloadInterface— extendsPhalcon\Domain\Payload\ReadableInterface,Phalcon\Domain\Payload\WriteableInterface,Phalcon\Contracts\Domain\Payload\Payload
Uses Phalcon\Contracts\Domain\Payload\Payload
Domain\Payload\ReadableInterface¶
Interface Source on GitHub
This interface is used for consumers (read only)
Phalcon\Contracts\Domain\Payload\ReadablePhalcon\Domain\Payload\ReadableInterface
Uses Phalcon\Contracts\Domain\Payload\Readable
Domain\Payload\Status¶
Class Source on GitHub
Holds the status codes for the payload.
The two failure-related statuses are distinct, following the Aura.Payload lineage:
ERRORmeans an exception was raised while the domain layer was running. By convention,Payload::setException()pairs with theERRORstatus.FAILUREmeans the domain layer ran to completion but declined the request (for example, a business rule was not satisfied); no exception was raised.
@see Payload
Phalcon\Domain\Payload\Status
Constants¶
string ACCEPTED = "ACCEPTED" string AUTHENTICATED = "AUTHENTICATED" string AUTHORIZED = "AUTHORIZED" string CREATED = "CREATED" string DELETED = "DELETED" string ERROR = "ERROR" string FAILURE = "FAILURE" string FOUND = "FOUND" string NOT_ACCEPTED = "NOT_ACCEPTED" string NOT_AUTHENTICATED = "NOT_AUTHENTICATED" string NOT_AUTHORIZED = "NOT_AUTHORIZED" string NOT_CREATED = "NOT_CREATED" string NOT_DELETED = "NOT_DELETED" string NOT_FOUND = "NOT_FOUND" string NOT_UPDATED = "NOT_UPDATED" string NOT_VALID = "NOT_VALID" string PROCESSING = "PROCESSING" string SUCCESS = "SUCCESS" string UPDATED = "UPDATED" string VALID = "VALID" Domain\Payload\WriteableInterface¶
Interface Source on GitHub
This interface is used for consumers (write)
Phalcon\Contracts\Domain\Payload\WriteablePhalcon\Domain\Payload\WriteableInterface
Uses Phalcon\Contracts\Domain\Payload\Writeable