Bristol SU Support Package
src
Action
ActionResponse.php
Go to the documentation of this file.
1
<?php
2
3
namespace
BristolSU\Support\Action
;
4
5
class
ActionResponse
6
{
7
11
protected
$success
;
12
16
protected
$message
;
17
23
public
function
setMessage
(
string
$message
): void
24
{
25
$this->message =
$message
;
26
}
27
33
public
function
getMessage
(): ?string
34
{
35
return
$this->message
;
36
}
37
43
public
function
setSuccess
(
bool
$success
): void
44
{
45
$this->
success
=
$success
;
46
}
47
52
public
function
getSuccess
(): ?bool
53
{
54
return
$this->success
;
55
}
56
63
public
static
function
success
(
string
$message
=
''
):
ActionResponse
64
{
65
$response =
new
self
;
66
$response->
setSuccess
(
true
);
67
$response->setMessage(
$message
);
68
return
$response;
69
}
70
77
public
static
function
failure
(
string
$message
=
''
):
ActionResponse
78
{
79
$response =
new
self
;
80
$response->
setSuccess
(
false
);
81
$response->setMessage(
$message
);
82
return
$response;
83
}
84
85
}
BristolSU\Support\Action\ActionResponse\failure
static failure(string $message='')
Definition:
ActionResponse.php:77
BristolSU\Support\Action\ActionResponse\$message
$message
Definition:
ActionResponse.php:16
BristolSU\Support\Action\ActionResponse\setMessage
setMessage(string $message)
Definition:
ActionResponse.php:23
BristolSU\Support\Action
Definition:
ActionBuilder.php:4
BristolSU\Support\Action\ActionResponse\getMessage
getMessage()
Definition:
ActionResponse.php:33
BristolSU\Support\Action\ActionResponse
Definition:
ActionResponse.php:5
BristolSU\Support\Action\ActionResponse\$success
$success
Definition:
ActionResponse.php:11
BristolSU\Support\Action\ActionResponse\getSuccess
getSuccess()
Definition:
ActionResponse.php:52
BristolSU\Support\Action\ActionResponse\setSuccess
setSuccess(bool $success)
Definition:
ActionResponse.php:43
BristolSU\Support\Action\ActionResponse\success
static success(string $message='')
Definition:
ActionResponse.php:63
Generated by
1.8.13