public static function buildResponse($value, $success, $httpCode, Paginer $pagingInfo = null)
    {
        $response = new stdClass();
        $response->success = $success;
        $response->http_code = $httpCode;

        if ($pagingInfo) {
            $response->pageNumber = $pagingInfo->getPageNumber();
            $response->pageSize = $pagingInfo->getPageSize();

            $totalPages = $pagingInfo->getPageCount();
            if ($totalPages > 0) {
                $response->totalPages = $totalPages;
            }
        }

        $response->data = $value;

        return $response;
    }
public static function buildResponse($value, $success, $httpCode, Paginer $pagingInfo = null)
    {
        $response = new stdClass();
        $response->success = $success;
        $response->http_code = $httpCode;

        if ($pagingInfo) {
            $response->pageNumber = $pagingInfo->getPageNumber();
            $response->pageSize = $pagingInfo->getPageSize();

            $totalPages = $pagingInfo->getPageCount();
            if ($totalPages > 0) {
                $response->totalPages = $totalPages;
            }
        }

        $response->data = $value;

        return $response;
    }
public static function buildResponse ( $ value , $ success , $ httpCode , Paginer $ pagingInfo = null ) { $ response = new stdClass ( ) ; $ response -> success = $ success ; $ response -> http_code = $ httpCode ; if ( $ pagingInfo ) { $ response -> pageNumber = $ pagingInfo -> getPageNumber ( ) ; $ response -> pageSize = $ pagingInfo -> getPageSize ( ) ; $ totalPages = $ pagingInfo -> getPageCount ( ) ; if ( $ totalPages > 0 ) { $ response -> totalPages = $ totalPages ; } } $ response -> data = $ value ; return $ response ; }
Builds API response.

@param mixed   $value      The response
@param bool    $success    Set to true for success, false for failure
@param int     $httpCode   The HTTP response code
@param Paginer $pagingInfo The pagination information coming from Paginer interface

@return stdClass
Builds API response .