mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-05 06:09:27 +00:00
0c2c0468af
- Added methods _success and _error to classes FHC_model and APIv1_Controller
31 lines
690 B
PHP
31 lines
690 B
PHP
<?php
|
|
|
|
/** ---------------------------------------------------------------
|
|
* General Error
|
|
*
|
|
* @return array
|
|
*/
|
|
function success($retval, $message = FHC_SUCCESS)
|
|
{
|
|
$return = new stdClass();
|
|
$return->error = EXIT_SUCCESS;
|
|
$return->fhcCode = $message;
|
|
$return->msg = lang('fhc_' . $message);
|
|
$return->retval = $retval;
|
|
return $return;
|
|
}
|
|
|
|
/** ---------------------------------------------------------------
|
|
* General Error
|
|
*
|
|
* @return array
|
|
*/
|
|
function error($retval = '', $message = FHC_MODEL_ERROR)
|
|
{
|
|
$return = new stdClass();
|
|
$return->error = EXIT_MODEL;
|
|
$return->fhcCode = $message;
|
|
$return->msg = lang('fhc_' . $message);
|
|
$return->retval = $retval;
|
|
return $return;
|
|
} |