progetto201 API
|
Functions | |
valid_times ($t_conn_res) | |
Checks if the request timestamps are valid. More... | |
set_times ($t_conn_res, $mintime, $maxtime) | |
Sets the timestamp's range in the options table. More... | |
Variables | |
$response = array('errors' => array()) | |
Prepare default response array with no errors. More... | |
set_times | ( | $t_conn_res, | |
$mintime, | |||
$maxtime | |||
) |
Sets the timestamp's range in the options table.
The function prepares the UPDATE query with two integers: $mintime e $maxtime.
If the query executing throws an error or it doesn't affect any row then the error is collected in the $action_res array.
If there where no errors, the 'data' of the $action_res array has the values sent by the request.
array | $t_conn_res | array with the connection object |
int | $mintime | minimum timestamp |
int | $maxtime | maximum timestamp |
valid_times | ( | $t_conn_res | ) |
Checks if the request timestamps are valid.
The function collect the mintime and maxtime timestamps, checks if they are numbers.
If they are numbers their values must be equal to zero or the mintime value has to be lower than the maxtime value.
In these cases, the set_times() function is called to set the time in the DB.
Otherwise an error is collected in the $action_res array
array | $t_conn_res | array with the connection object |
$response = array('errors' => array()) |
Prepare default response array with no errors.