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
$model
public
mixed
$model
$pagination_vars
public
mixed
$pagination_vars
= array('records', 'limit', 'start', 'from', 'p', 'page')
$DB
private
mixed
$DB
$field
private
mixed
$field
= array()
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
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
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
Return values
bool|string —Returns FALSE if all vars are valid or the variable name if it's found as not valid