PHP 클래스 Piwik\API\ResponseBuilder

파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $outputFormat, array $request = [] )
disableDataTablePostProcessor ( )
disableSendHeader ( )
getResponse ( mixed $value = null, boolean | string $apiModule = false, boolean | string $apiMethod = false ) : mixed This method processes the data resulting from the API call.
getResponseException ( Exceptio\Exception | Throwable $e ) : string Returns an error $message in the requested $format

비공개 메소드들

메소드 설명
decorateExceptionWithDebugTrace ( Exceptio\Exception | Throwable $e ) : Exception
formatExceptionMessage ( Exceptio\Exception | Throwable $exception ) : string
handleArray ( $array )
handleDataTable ( Piwik\DataTable\DataTableInterface $datatable )
sendHeaderIfEnabled ( )

메소드 상세

__construct() 공개 메소드

public __construct ( string $outputFormat, array $request = [] )
$outputFormat string
$request array

disableDataTablePostProcessor() 공개 메소드

disableSendHeader() 공개 메소드

public disableSendHeader ( )

getResponse() 공개 메소드

- If the data resulted from the API call is a DataTable then - we apply the standard filters if the parameters have been found in the URL. For example to offset,limit the Table you can add the following parameters to any API call that returns a DataTable: filter_limit=10&filter_offset=20 - we apply the filters that have been previously queued on the DataTable
또한 보기: DataTable::queueFilter() - we apply the renderer that generate the DataTable in a given format (XML, PHP, HTML, JSON, etc.) the format can be changed using the 'format' parameter in the request. Example: format=xml - If there is nothing returned (void) we display a standard success message - If there is a PHP array returned, we try to convert it to a dataTable It is then possible to convert this datatable to any requested format (xml/etc) - If a bool is returned we convert to a string (true is displayed as 'true' false as 'false') - If an integer / float is returned, we simply return it
public getResponse ( mixed $value = null, boolean | string $apiModule = false, boolean | string $apiMethod = false ) : mixed
$value mixed The initial returned value, before post process. If set to null, success response is returned.
$apiModule boolean | string The API module that was called
$apiMethod boolean | string The API method that was called
리턴 mixed Usually a string, but can still be a PHP data structure if the format requested is 'original'

getResponseException() 공개 메소드

Returns an error $message in the requested $format
public getResponseException ( Exceptio\Exception | Throwable $e ) : string
$e Exceptio\Exception | Throwable
리턴 string