Documentation

RoutesHelper
in package

Table of Contents

$model  : mixed
$pagination_vars  : mixed
$DB  : mixed
$field  : mixed
__construct()  : mixed
addPagination()  : array<string|int, mixed>
Returns properly formatted pagination data for API response This is mostly passthru and only used to make sure pagination data is under its own pagination array item You can use this method to receive a pagination information array you can merge with your response package You can NOT use this method to add this package to your response array under the pagination key, because you can't nest it
addRecords()  : array<string|int, mixed>
Returns properly formatted records data for API response You can use this method to receive a records information array you can merge with your response package You can NOT use this method to add this package to your response array under the records key, because you can't nest it
buildSongsData()  : mixed
doReturnData()  : mixed
validateGame()  : mixed
validatevars()  : bool|string
Returns true if provided vars are all valid and allowed

Properties

$pagination_vars

public mixed $pagination_vars = array('records', 'limit', 'start', 'from', 'p', 'page')

Methods

__construct()

public __construct() : mixed
Return values
mixed

addPagination()

Returns properly formatted pagination data for API response This is mostly passthru and only used to make sure pagination data is under its own pagination array item You can use this method to receive a pagination information array you can merge with your response package You can NOT use this method to add this package to your response array under the pagination key, because you can't nest it

public addPagination(mixed $pagination_data[, mixed $return_package = [] ]) : array<string|int, mixed>
Parameters
$pagination_data : mixed
$return_package : mixed = []
Tags
pagination_data

array : Pagination data from C3Tools::doPagination()

return_package

array OPTIONAL : Response array to add records data to

Return values
array<string|int, mixed>

addRecords()

Returns properly formatted records data for API response You can use this method to receive a records information array you can merge with your response package You can NOT use this method to add this package to your response array under the records key, because you can't nest it

public addRecords(mixed $total, mixed $total_filtered, mixed $count[, mixed $additional_totals = [] ]) : array<string|int, mixed>
Parameters
$total : mixed
$total_filtered : mixed
$count : mixed
$additional_totals : mixed = []
Tags
total

int : Total number of records available in DB

total_filtered

int : Total number of records filtered before pagination

count

int : Number of records returned by the endpoint

additional_totals

array : Array of additional totals you need to deliver for special cases

Return values
array<string|int, mixed>

buildSongsData()

public static buildSongsData(mixed $field, mixed $field_value, mixed $data[, mixed $where = false ]) : mixed
Parameters
$field : mixed
$field_value : mixed
$data : mixed
$where : mixed = false
Return values
mixed

doReturnData()

public doReturnData(mixed $data, mixed $options) : mixed
Parameters
$data : mixed
$options : mixed
Return values
mixed

validateGame()

public validateGame(mixed $game[, mixed $field = false ]) : mixed
Parameters
$game : mixed
$field : mixed = false
Return values
mixed

validatevars()

Returns true if provided vars are all valid and allowed

public validatevars(mixed $sent_vars, mixed $valid_vars) : bool|string
Parameters
$sent_vars : mixed
$valid_vars : mixed
Tags
sent_vars

array : Array of vars sent by user

valid_vars

array : Array of alllowed vars

Return values
bool|string

Returns FALSE if all vars are valid or the variable name if it's found as not valid

Search results