Files

42 lines
734 B
PHP
Raw Permalink Normal View History

2024-01-29 10:39:53 +07:00
<?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;
}
}