Result
class Result (View source)
An immutable result object often detailing the result of a registration or validation completed by the respective handlers
Traits
A class that can be instantiated or replaced via DI
Properties
protected | bool | $success | Indicates this result was successful |
|
protected | string | $message | An message describing the result |
|
protected | array | $context | Context provided by the handler returning this result |
Methods
No description
Creates a class instance by the "singleton" design pattern.
Details
static Result
create(bool $success = true, string $message = '', array $context = [])
No description
static Injectable
singleton(string $class = null)
Creates a class instance by the "singleton" design pattern.
It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).
__construct(bool $success = true, string $message = '', array $context = [])
No description
bool
isSuccessful()
No description
string
getMessage()
No description
array
getContext()
No description
Result
setSuccessful(bool $success)
No description
Result
setMessage(string $message)
No description
Result
setContext(array $context)
No description