c
This commit is contained in:
41
inc/Hura8/Interfaces/AppResponse.php
Normal file
41
inc/Hura8/Interfaces/AppResponse.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Hura8\Interfaces;
|
||||
|
||||
class AppResponse
|
||||
{
|
||||
const SUCCESS = 'ok';
|
||||
const ERROR = 'error';
|
||||
|
||||
protected $status;
|
||||
protected $msg = null;
|
||||
protected $data;
|
||||
|
||||
public function __construct($status = 'ok', $msg = null, $data = null) {
|
||||
$this->status = $status;
|
||||
$this->msg = $msg;
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string which is 'ok' or 'error'
|
||||
*/
|
||||
public function getStatus() {
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed if status = 'error'
|
||||
*/
|
||||
public function getMsg() {
|
||||
return $this->msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed if status = 'ok'
|
||||
*/
|
||||
public function getData() {
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user