TimeTrex API Manual

APIClientStationUnAuthenticated extends APIFactory
in package

Table of Contents

$data  : mixed
$api_message_id  : mixed
$company_obj  : mixed
$current_company  : mixed
$current_user  : mixed
$current_user_prefs  : mixed
$kiosk_mode_type_ids  : mixed
$main_class_obj  : mixed
$pager_obj  : mixed
$permission  : mixed
$progress_bar_obj  : mixed
$station_obj  : mixed
$test_mode  : mixed
$type_ids  : mixed
__construct()  : mixed
APIClientStationUnAuthenticated constructor.
_convertCustomFieldPermissionsToLegacyOtherFieldPermissions()  : mixed
_convertCustomFieldsToLegacyOtherFields()  : mixed
_convertLegacyOtherFieldsToCustomFields()  : mixed
_getCustomFieldToLegacyOtherFieldMap()  : array<string|int, mixed>
checkAndSetNotificationDeviceToken()  : array<string|int, mixed>|bool
Checks if a device token is registered and sets it if it is not already registered.
convertAPIReturnHandlerToValidatorObject()  : bool|Validator
Take a API ReturnHandler array and pulls out the Validation errors/warnings to be merged back into another Validator This is useful for calling one API function from another one when their are sub-classes.
convertToMultipleRecords()  : array<string|int, mixed>
convertToSingleRecord()  : mixed
deleteUserIdentification()  : bool
exportRecords()  : array<string|int, mixed>|bool
Download a result_set as a csv.
getAPIMessageID()  : bool|null
Returns the API messageID for each individual call.
getBranches()  : array<string|int, mixed>|bool
getClientConfig()  : array<string|int, mixed>|bool
getClientVersion()  : bool|string
getCompanyGenericMapData()  : array<string|int, mixed>|bool
getCurrentCompanyObject()  : bool|CompanyFactory
getCurrentUserObject()  : bool|UserFactory
getCurrentUserPreferenceObject()  : bool|UserPreferenceFactory
getDate()  : array<string|int, mixed>
getDefaultPunchSettings()  : array<string|int, mixed>|bool
getDepartments()  : array<string|int, mixed>|bool
getJobItems()  : array<string|int, mixed>|bool
getJobs()  : array<string|int, mixed>|bool
getJobToJobItemMap()  : array<string|int, mixed>|bool
If a job_id is not returned, then that means the job item (task) is allowed for all jobs
getJobToUserMap()  : array<string|int, mixed>|bool
If a job_id is not returned, then that means the job is allowed for all users.
getLatestVersion()  : string
Latest App version
getMainClassObject()  : string
getMessage()  : array<string|int, mixed>|bool
getNextInsertID()  : string
getOptions()  : array<string|int, mixed>|bool
Bridge to main class getOptions factory.
getOptionsBatch()  : array<string|int, mixed>
Bridge multiple batched requests to main class getOptions factory.
getOtherFields()  : array<string|int, mixed>|bool
Gets custom field meta data.
getPagerData()  : array<string|int, mixed>|bool
getPagerObject()  : Pager
getPermissionChildren()  : array<string|int, mixed>
getPermissionObject()  : bool|null|Permission
getPermissions()  : array<string|int, mixed>|bool
Gets all the permissions by permission_control_id.
getPermissionUsers()  : array<string|int, mixed>|bool
Gets all the users and the permission_control_id they are assigned to.
getProgressBarObject()  : null|ProgressBar
getProtocolVersion()  : int
getPunchTags()  : array<string|int, mixed>|bool
getSingleUserIdentification()  : array<string|int, mixed>|bool
getTimeZone()  : array<string|int, mixed>
getUserIdentification()  : array<string|int, mixed>|bool
The client needs to pass a list of new users that were just added to it, so the identification for those users is included no matter what, along with any new data.
getUserPreference()  : array<string|int, mixed>|bool
getUsers()  : array<string|int, mixed>|bool
Accept a list of valid_user_ids from getUserIDs() so we can always send data for those users.
getVariableToFunctionMap()  : array<string|int, mixed>
Bridge to main class getVariableToFunctionMap factory.
handlePermissionFilterColumns()  : array<string|int, mixed>|null
In cases where data can be displayed in just a list_view (dropdown boxes), ie: branch, department, job, task in In/Out punch view restrict the dropdown box to just a subset of columns, so not all data is shown.
handleRecordValidationResults()  : array<string|int, mixed>
initializeFilterAndPager()  : array<string|int, mixed>|bool
isLatestData()  : array<string|int, mixed>
isOutOfDateClientVersion()  : bool
isProgressBarStarted()  : bool
returnHandler()  : array<string|int, mixed>|bool
Controls returning information to client in a standard format.
setAPIMessageID()  : bool
setAttendance()  : array<string|int, mixed>|bool
setLog()  : array<string|int, mixed>|bool
setMainClassObject()  : bool
Allow storing the main class object persistently in memory, so we can build up other variables to help out things like getOptions() Mainly used for the APIReport class.
setPagerObject()  : bool
setProgressBarObject()  : bool
setUserIdentification()  : bool
setValidationArray()  : array<string|int, mixed>|bool
stationCheckAllowed()  : array<string|int, mixed>|bool
stripReturnHandler()  : mixed
test()  : bool
checkStationType()  : bool
getCompanyGenericMapObjectTypeIds()  : array<string|int, mixed>
Returns all relevant company_generic_map object_type_ids for data that needs to be synchronized.
getCompanyObject()  : CompanyFactory|bool
getStationID()  : bool
getStationObject()  : StationFactory|bool
getStationTypeID()  : bool|int
isKioskModeType()  : bool
isLoggedIn()  : bool
processPunches()  : bool

Properties

Methods

_convertCustomFieldPermissionsToLegacyOtherFieldPermissions()

public _convertCustomFieldPermissionsToLegacyOtherFieldPermissions( $permissions) : mixed
Parameters
$permissions :
Return values
mixed

_getCustomFieldToLegacyOtherFieldMap()

public _getCustomFieldToLegacyOtherFieldMap() : array<string|int, mixed>
Return values
array<string|int, mixed>

checkAndSetNotificationDeviceToken()

Checks if a device token is registered and sets it if it is not already registered.

public checkAndSetNotificationDeviceToken( $device_token,  $platform_id) : array<string|int, mixed>|bool
Parameters
$device_token :
$platform_id :
Return values
array<string|int, mixed>|bool

convertAPIReturnHandlerToValidatorObject()

Take a API ReturnHandler array and pulls out the Validation errors/warnings to be merged back into another Validator This is useful for calling one API function from another one when their are sub-classes.

public convertAPIReturnHandlerToValidatorObject( $api_retarr[, bool $validator_obj = false ]) : bool|Validator
Parameters
$api_retarr :
$validator_obj : bool = false
Return values
bool|Validator

convertToMultipleRecords()

public convertToMultipleRecords(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
Return values
array<string|int, mixed>

convertToSingleRecord()

public convertToSingleRecord(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

deleteUserIdentification()

public deleteUserIdentification(string $user_id, int $type_id,  $number) : bool
Parameters
$user_id : string

UUID

$type_id : int
$number :
Return values
bool

exportRecords()

Download a result_set as a csv.

public exportRecords(string $format, string $file_name, array<string|int, mixed> $result, array<string|int, mixed> $filter_columns) : array<string|int, mixed>|bool
Parameters
$format : string
$file_name : string
$result : array<string|int, mixed>
$filter_columns : array<string|int, mixed>
Return values
array<string|int, mixed>|bool

getAPIMessageID()

Returns the API messageID for each individual call.

public getAPIMessageID() : bool|null
Return values
bool|null

getBranches()

public getBranches(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getClientConfig()

public getClientConfig([null $device_os = null ][, null $device_model = null ][, null $device_os_version = null ][, array<string|int, mixed> $current_client_config = [] ]) : array<string|int, mixed>|bool
Parameters
$device_os : null = null
$device_model : null = null
$device_os_version : null = null
$current_client_config : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getCompanyGenericMapData()

public getCompanyGenericMapData(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getDefaultPunchSettings()

public getDefaultPunchSettings([string $user_id = null ][, int $epoch = null ][, float $latitude = null ][, float $longitude = null ][, float $position_accuracy = null ]) : array<string|int, mixed>|bool
Parameters
$user_id : string = null

UUID

$epoch : int = null

EPOCH

$latitude : float = null
$longitude : float = null
$position_accuracy : float = null
Return values
array<string|int, mixed>|bool

getDepartments()

public getDepartments(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getJobItems()

public getJobItems(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getJobs()

public getJobs(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getJobToJobItemMap()

If a job_id is not returned, then that means the job item (task) is allowed for all jobs

public getJobToJobItemMap(int $last_update_epoch) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
Return values
array<string|int, mixed>|bool

getJobToUserMap()

If a job_id is not returned, then that means the job is allowed for all users.

public getJobToUserMap(int $last_update_epoch) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
Return values
array<string|int, mixed>|bool

getMainClassObject()

public getMainClassObject() : string
Return values
string

getMessage()

public getMessage(string $user_id, int $status_id, int $type_id, int $order) : array<string|int, mixed>|bool
Parameters
$user_id : string

UUID

$status_id : int
$type_id : int
$order : int
Return values
array<string|int, mixed>|bool

getNextInsertID()

public getNextInsertID() : string
Return values
string

getOptions()

Bridge to main class getOptions factory.

public getOptions([bool $name = false ][, string|int $parent = null ]) : array<string|int, mixed>|bool
Parameters
$name : bool = false
$parent : string|int = null
Return values
array<string|int, mixed>|bool

getOptionsBatch()

Bridge multiple batched requests to main class getOptions factory.

public getOptionsBatch([array<string|int, mixed> $requested_options = [] ]) : array<string|int, mixed>
Parameters
$requested_options : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getOtherFields()

Gets custom field meta data.

public getOtherFields(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getPagerData()

public getPagerData() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool

getPermissionChildren()

public getPermissionChildren() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPermissions()

Gets all the permissions by permission_control_id.

public getPermissions(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getPermissionUsers()

Gets all the users and the permission_control_id they are assigned to.

public getPermissionUsers(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getProtocolVersion()

public getProtocolVersion() : int
Return values
int

getPunchTags()

public getPunchTags(int $last_update_epoch[, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getSingleUserIdentification()

public getSingleUserIdentification(string $user_id[, int $type_id = 70 ]) : array<string|int, mixed>|bool
Parameters
$user_id : string

UUID

$type_id : int = 70
Return values
array<string|int, mixed>|bool

getUserIdentification()

The client needs to pass a list of new users that were just added to it, so the identification for those users is included no matter what, along with any new data.

public getUserIdentification(int $last_update_epoch[, array<string|int, mixed> $clock_user_ids = [] ][, array<string|int, mixed> $remote_ids = [] ]) : array<string|int, mixed>|bool

The client will need to do this automatically.

Parameters
$last_update_epoch : int
$clock_user_ids : array<string|int, mixed> = []
$remote_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getUserPreference()

public getUserPreference(int $last_update_epoch[, array<string|int, mixed> $clock_user_ids = [] ]) : array<string|int, mixed>|bool
Parameters
$last_update_epoch : int
$clock_user_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getUsers()

Accept a list of valid_user_ids from getUserIDs() so we can always send data for those users.

public getUsers(int $last_update_epoch[, array<string|int, mixed> $remote_user_ids = [] ]) : array<string|int, mixed>|bool

as well as sending updated data based on last_update_epoch. Since users can be assigned/unassigned from the client without updating their own data in some cases.

Parameters
$last_update_epoch : int
$remote_user_ids : array<string|int, mixed> = []
Return values
array<string|int, mixed>|bool

getVariableToFunctionMap()

Bridge to main class getVariableToFunctionMap factory.

public getVariableToFunctionMap(string $name[, string|int $parent = null ]) : array<string|int, mixed>
Parameters
$name : string
$parent : string|int = null
Return values
array<string|int, mixed>

handlePermissionFilterColumns()

In cases where data can be displayed in just a list_view (dropdown boxes), ie: branch, department, job, task in In/Out punch view restrict the dropdown box to just a subset of columns, so not all data is shown.

public handlePermissionFilterColumns(array<string|int, mixed> $filter_columns, array<string|int, mixed> $allowed_columns) : array<string|int, mixed>|null
Parameters
$filter_columns : array<string|int, mixed>
$allowed_columns : array<string|int, mixed>
Return values
array<string|int, mixed>|null

handleRecordValidationResults()

public handleRecordValidationResults(object|bool $validator, array<string|int, mixed> $validator_stats, int $key, array<string|int, mixed>|bool $save_result[, bool $user_generic_status_batch_id = false ][, mixed $system_job_queue = false ]) : array<string|int, mixed>
Parameters
$validator : object|bool
$validator_stats : array<string|int, mixed>
$key : int
$save_result : array<string|int, mixed>|bool
$user_generic_status_batch_id : bool = false
$system_job_queue : mixed = false
Return values
array<string|int, mixed>

initializeFilterAndPager()

public initializeFilterAndPager(array<string|int, mixed> $data[, bool $disable_paging = false ]) : array<string|int, mixed>|bool
Parameters
$data : array<string|int, mixed>
$disable_paging : bool = false
Return values
array<string|int, mixed>|bool

isLatestData()

public isLatestData(int $last_check_epoch[, int $station_epoch = null ]) : array<string|int, mixed>
Parameters
$last_check_epoch : int

EPOCH

$station_epoch : int = null

EPOCH

Return values
array<string|int, mixed>

isProgressBarStarted()

public isProgressBarStarted() : bool
Return values
bool

returnHandler()

Controls returning information to client in a standard format.

public returnHandler([bool $retval = true ][, bool $code = false ][, bool $description = false ][, bool $details = false ][, bool $validator_stats = false ][, bool $user_generic_status_batch_id = false ][, bool $request_data = false ][, bool $system_job_queue = false ]) : array<string|int, mixed>|bool

FIXME: Need to return the original request (with any modified values due to restrictions/validation issues) Also need to return paging data variables here too, as JSON can't make multiple calls. In order to do this we need to always return a special data structure that includes this information. static function returnHandler( $retval = TRUE, $args = array( 'code' => FALSE, 'description' => FALSE, 'details' = FALSE, 'validator_stats' => FALSE, 'user_generic_status_batch_id' => FALSE ) ) { The above will require too many changes, just add two more variables at the end, as it will only really be used by API->get*() functions. FIXME: Use a requestHandler() to handle all input requests, so we can parse out things like validate_only, ignore_warning (for user acknowledgable warnings) and handling all parameter parsing in a central place. static function returnHandler( $retval = TRUE, $code = FALSE, $description = FALSE, $details = FALSE, $validator_stats = FALSE, $user_generic_status_batch_id = FALSE, $request = FALSE, $pager = FALSE ) {

Parameters
$retval : bool = true
$code : bool = false
$description : bool = false
$details : bool = false
$validator_stats : bool = false
$user_generic_status_batch_id : bool = false
$request_data : bool = false
$system_job_queue : bool = false
Return values
array<string|int, mixed>|bool

setAPIMessageID()

public setAPIMessageID(string $id) : bool
Parameters
$id : string

UUID

Return values
bool

setAttendance()

public setAttendance([bool $data = false ]) : array<string|int, mixed>|bool
Parameters
$data : bool = false
Return values
array<string|int, mixed>|bool

setLog()

public setLog([null $data = null ]) : array<string|int, mixed>|bool
Parameters
$data : null = null
Return values
array<string|int, mixed>|bool

setMainClassObject()

Allow storing the main class object persistently in memory, so we can build up other variables to help out things like getOptions() Mainly used for the APIReport class.

public setMainClassObject(object $obj) : bool
Parameters
$obj : object
Return values
bool

setPagerObject()

public setPagerObject(object $lf) : bool
Parameters
$lf : object
Return values
bool

setProgressBarObject()

public setProgressBarObject( $progress_bar_obj) : bool
Parameters
$progress_bar_obj :
Return values
bool

setValidationArray()

public setValidationArray(array<string|int, Validator$validator_obj_arr[, string $record_label = null ]) : array<string|int, mixed>|bool
Parameters
$validator_obj_arr : array<string|int, Validator>

Array of Validator objects.

$record_label : string = null

Prefix for record label if performing a mass function to differentiate one record from another.

Return values
array<string|int, mixed>|bool

stripReturnHandler()

public stripReturnHandler(mixed $retarr) : mixed
Parameters
$retarr : mixed
Return values
mixed

getCompanyGenericMapObjectTypeIds()

Returns all relevant company_generic_map object_type_ids for data that needs to be synchronized.

private getCompanyGenericMapObjectTypeIds() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results