status = true; $objResultWrapper->data = $data; return $objResultWrapper; } /** * 表示处理失败 * * @param mixed $data * * @return ResultWrapper */ public static function fail($data = null, $errorCode) { $objResultWrapper = new self(); $objResultWrapper->status = false; $objResultWrapper->data = $data; $objResultWrapper->errorCode = $errorCode; return $objResultWrapper; } /** * 判断处理是否成功 * * @return Boolean */ public function isSuccess() { return $this->status === true; } /** * 获取数据 * * @return mixed */ public function getData() { return $this->data; } /** * 获取错误编码 * * @return int */ public function getErrorCode() { return $this->errorCode; } }