XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
Response.php
Go to the documentation of this file.
1
<?php
2
/*
3
You may not change or alter any portion of this comment or credits
4
of supporting developers from this source code or any supporting source code
5
which is considered copyrighted (c) material of the original comment or credit authors.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
12
namespace
Xoops\Core\Service
;
13
30
class
Response
31
{
33
protected
$value
= null;
34
36
protected
$success
=
true
;
37
39
protected
$errorMessage
= null;
40
50
public
function
__constructor
(
$value
= null,
$success
=
true
,
$errorMessage
= null)
51
{
52
$this->value =
$value
;
53
$this->success =
$success
;
54
if
(
$errorMessage
!==null) {
55
$this->
addErrorMessage
(
$errorMessage
);
56
}
57
}
58
64
public
function
getValue
()
65
{
66
return
$this->value
;
67
}
68
74
public
function
isSuccess
()
75
{
76
return
$this->success
;
77
}
78
84
public
function
getErrorMessage
()
85
{
86
return
$this->errorMessage
;
87
}
88
96
public
function
setValue
(
$value
)
97
{
98
$this->value =
$value
;
99
100
return
$this;
101
}
102
110
public
function
setSuccess
(
$success
)
111
{
112
$this->success =
$success
;
113
114
return
$this;
115
}
116
124
public
function
addErrorMessage
(
$errorMessage
)
125
{
126
$ret = array();
127
if
(is_array($this->errorMessage)) {
128
$ret =
$this->errorMessage
;
129
} elseif (is_scalar($this->errorMessage)) {
130
$ret[] =
$this->errorMessage
;
131
}
132
if
(is_array(
$errorMessage
)) {
133
$ret = array_merge($ret,
$errorMessage
);
134
} elseif (is_scalar(
$errorMessage
)) {
135
$ret[] =
$errorMessage
;
136
}
137
138
$this->errorMessage = $ret;
139
140
return
$this;
141
}
142
}
Xoops\Core\Service\Response\getErrorMessage
getErrorMessage()
Definition:
Response.php:84
Xoops\Core\Service\Response\setValue
setValue($value)
Definition:
Response.php:96
Xoops\Core\Service\Response\$success
$success
Definition:
Response.php:36
Xoops\Core\Service
Definition:
AbstractContract.php:12
Xoops\Core\Service\Response\isSuccess
isSuccess()
Definition:
Response.php:74
Xoops\Core\Service\Response
Definition:
Response.php:30
Xoops\Core\Service\Response\addErrorMessage
addErrorMessage($errorMessage)
Definition:
Response.php:124
Xoops\Core\Service\Response\__constructor
__constructor($value=null, $success=true, $errorMessage=null)
Definition:
Response.php:50
Xoops\Core\Service\Response\setSuccess
setSuccess($success)
Definition:
Response.php:110
Xoops\Core\Service\Response\getValue
getValue()
Definition:
Response.php:64
Xoops\Core\Service\Response\$errorMessage
$errorMessage
Definition:
Response.php:39
Xoops\Core\Service\Response\$value
$value
Definition:
Response.php:33
usr64
htdocs
xoops_lib
Xoops
Core
Service
Response.php
Generated on Fri May 22 2015 03:07:05 for XOOPS by
1.8.9.1