42 lines
734 B
PHP
42 lines
734 B
PHP
<?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;
|
|
}
|
|
|
|
}
|