Skip to content

Phalcon Domain

Updated View as Markdown

Domain\Payload\Payload

ClassSource on GitHub

Holds the payload

Uses Throwable

Method Summary

Properties

protectedThrowable|null$exception = nullException if any
protectedmixed$extrasExtra information
protectedmixed$inputInput
protectedmixed$messagesMessages
protectedmixed$outputOutput
protectedmixed$statusStatus

Methods

Public · 12

getException()

public function getException(): Throwable|null;

Gets the potential exception thrown in the domain layer

getExtras()

public function getExtras(): mixed;

Extra information

getInput()

public function getInput(): mixed;

Input

getMessages()

public function getMessages(): mixed;

Messages

getOutput()

public function getOutput(): mixed;

Output

getStatus()

public function getStatus(): mixed;

Status

Status values are drawn from the Status vocabulary.

@see Status

setException()

public function setException( Throwable $exception ): PayloadInterface;

Sets an exception thrown in the domain

setExtras()

public function setExtras( mixed $extras ): PayloadInterface;

Sets arbitrary extra domain information.

setInput()

public function setInput( mixed $input ): PayloadInterface;

Sets the domain input.

setMessages()

public function setMessages( mixed $messages ): PayloadInterface;

Sets the domain messages.

setOutput()

public function setOutput( mixed $output ): PayloadInterface;

Sets the domain output.

setStatus()

public function setStatus( mixed $status ): PayloadInterface;

Sets the payload status.

Status values are drawn from the Status vocabulary.

@see Status

Domain\Payload\PayloadFactory

ClassSource 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

Public · 1

newInstance()

public function newInstance(): PayloadInterface;

Instantiate a new object

Domain\Payload\PayloadInterface

InterfaceSource on GitHub

This interface is used for consumers

Uses Phalcon\Contracts\Domain\Payload\Payload

Domain\Payload\ReadableInterface

InterfaceSource on GitHub

This interface is used for consumers (read only)

Uses Phalcon\Contracts\Domain\Payload\Readable

Domain\Payload\Status

ClassSource on GitHub

Holds the status codes for the payload.

The two failure-related statuses are distinct, following the Aura.Payload lineage:

  • ERROR means an exception was raised while the domain layer was running. By convention, Payload::setException() pairs with the ERROR status.
  • FAILURE means 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

stringACCEPTED = "ACCEPTED"
stringAUTHENTICATED = "AUTHENTICATED"
stringAUTHORIZED = "AUTHORIZED"
stringCREATED = "CREATED"
stringDELETED = "DELETED"
stringERROR = "ERROR"
stringFAILURE = "FAILURE"
stringFOUND = "FOUND"
stringNOT_ACCEPTED = "NOT_ACCEPTED"
stringNOT_AUTHENTICATED = "NOT_AUTHENTICATED"
stringNOT_AUTHORIZED = "NOT_AUTHORIZED"
stringNOT_CREATED = "NOT_CREATED"
stringNOT_DELETED = "NOT_DELETED"
stringNOT_FOUND = "NOT_FOUND"
stringNOT_UPDATED = "NOT_UPDATED"
stringNOT_VALID = "NOT_VALID"
stringPROCESSING = "PROCESSING"
stringSUCCESS = "SUCCESS"
stringUPDATED = "UPDATED"
stringVALID = "VALID"

Domain\Payload\WriteableInterface

InterfaceSource on GitHub

This interface is used for consumers (write)

Uses Phalcon\Contracts\Domain\Payload\Writeable

Type to search…

↑↓ navigate↵ selectEsc close