TimeTrex API Manual

APICompany extends APIFactory
in package

Table of Contents

$data  : mixed
$api_message_id  : mixed
$current_company  : mixed
$current_user  : mixed
$current_user_prefs  : mixed
$main_class  : mixed
$main_class_obj  : mixed
$pager_obj  : mixed
$permission  : mixed
$progress_bar_obj  : mixed
__construct()  : mixed
APICompany constructor.
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
copyCompany()  : array<string|int, mixed>
Copy one or more companyes.
deleteCompany()  : array<string|int, mixed>|bool
Delete one or more companys.
deleteImage()  : bool
exportCompany()  : array<string|int, mixed>|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.
getCommonCompanyData()  : array<string|int, mixed>
Get only the fields that are common across all records in the search criteria. Used for Mass Editing of records.
getCompany()  : array<string|int, mixed>|bool
Get company data for one or more companyes.
getCompanyDefaultData()  : array<string|int, mixed>
Get default company data for creating new companyes.
getCompanyEmailAddresses()  : array<string|int, mixed>|bool
Get user email addresses for a single company. We should be able to support multiple companies as well, or getting data for all companies by not specifying the company filter.
getCompanyMinAvgMaxUserCounts()  : array<string|int, mixed>|bool
Get user counts for a single company. We should be able to support multiple companies as well, or getting data for all companies by not specifying the company filter.
getCompanyPhonePunchData()  : array<string|int, mixed>|bool
Get phone minutes for a single company. We should be able to support multiple companies as well, or getting data for all companies by not specifying the company filter.
getCompanyStationCounts()  : array<string|int, mixed>|bool
Get station counts for a single company. We should be able to support multiple companies as well, or getting data for all companies by not specifying the company filter.
getCompanyTimeClockStations()  : array<string|int, mixed>|bool
Get timeclock stations associated with each company.
getCurrentCompanyObject()  : bool|CompanyFactory
getCurrentUserObject()  : bool|UserFactory
getCurrentUserPreferenceObject()  : bool|UserPreferenceFactory
getMainClassObject()  : string
getNextInsertID()  : string
getOptions()  : bool|array<string|int, mixed>
Get options for dropdown boxes.
getOptionsBatch()  : array<string|int, mixed>
Bridge multiple batched requests to main class getOptions factory.
getPagerData()  : array<string|int, mixed>|bool
getPagerObject()  : Pager
getPermissionChildren()  : array<string|int, mixed>
getPermissionObject()  : bool|null|Permission
getProgressBarObject()  : null|ProgressBar
getProtocolVersion()  : int
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
isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled()  : array<string|int, mixed>
Return an array to determine if branches, department, job, task and punch tag dropdown boxes should be enabled and have data.
isProgressBarStarted()  : bool
returnHandler()  : array<string|int, mixed>|bool
Controls returning information to client in a standard format.
setAPIMessageID()  : bool
setCompany()  : array<string|int, mixed>|bool
Set company data for one or more companyes.
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
setValidationArray()  : array<string|int, mixed>|bool
stripReturnHandler()  : mixed
validateCompany()  : array<string|int, mixed>
Validate company data for one or more companyes.

Properties

Methods

__construct()

APICompany constructor.

public __construct() : mixed
Return values
mixed

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

copyCompany()

Copy one or more companyes.

public copyCompany(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

company data

Return values
array<string|int, mixed>

deleteCompany()

Delete one or more companys.

public deleteCompany(array<string|int, mixed> $data) : array<string|int, mixed>|bool
Parameters
$data : array<string|int, mixed>

company data

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

deleteImage()

public deleteImage( $company_id) : bool
Parameters
$company_id :
Return values
bool

exportCompany()

public exportCompany([string $format = 'csv' ][, array<string|int, mixed> $data = null ][, bool $disable_paging = true ]) : array<string|int, mixed>|bool
Parameters
$format : string = 'csv'
$data : array<string|int, mixed> = null
$disable_paging : bool = true
Return values
array<string|int, mixed>|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

getCommonCompanyData()

Get only the fields that are common across all records in the search criteria. Used for Mass Editing of records.

public getCommonCompanyData(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

filter data

Return values
array<string|int, mixed>

getCompany()

Get company data for one or more companyes.

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

filter data

$disable_paging : bool = false
Return values
array<string|int, mixed>|bool

getCompanyDefaultData()

Get default company data for creating new companyes.

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

getCompanyEmailAddresses()

Get user email addresses for a single company. We should be able to support multiple companies as well, or getting data for all companies by not specifying the company filter.

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

filter data

$disable_paging : bool = false
Return values
array<string|int, mixed>|bool

getCompanyMinAvgMaxUserCounts()

Get user counts for a single company. We should be able to support multiple companies as well, or getting data for all companies by not specifying the company filter.

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

filter data

$disable_paging : bool = false
Return values
array<string|int, mixed>|bool

getCompanyPhonePunchData()

Get phone minutes for a single company. We should be able to support multiple companies as well, or getting data for all companies by not specifying the company filter.

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

filter data

$disable_paging : bool = false
Return values
array<string|int, mixed>|bool

getCompanyStationCounts()

Get station counts for a single company. We should be able to support multiple companies as well, or getting data for all companies by not specifying the company filter.

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

filter data

$disable_paging : bool = false
Return values
array<string|int, mixed>|bool

getCompanyTimeClockStations()

Get timeclock stations associated with each company.

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

filter data

$disable_paging : bool = false
Return values
array<string|int, mixed>|bool

getMainClassObject()

public getMainClassObject() : string
Return values
string

getNextInsertID()

public getNextInsertID() : string
Return values
string

getOptions()

Get options for dropdown boxes.

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

Name of options to return, ie: 'columns', 'type', 'status'

$parent : mixed = null

Parent name/ID of options to return if data is in hierarchical format. (ie: Province)

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

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>

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>

getProtocolVersion()

public getProtocolVersion() : int
Return values
int

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

isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled()

Return an array to determine if branches, department, job, task and punch tag dropdown boxes should be enabled and have data.

public isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled() : array<string|int, mixed>
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

setCompany()

Set company data for one or more companyes.

public setCompany(array<string|int, mixed> $data[, bool $validate_only = false ][, bool $ignore_warning = true ]) : array<string|int, mixed>|bool
Parameters
$data : array<string|int, mixed>

company data

$validate_only : bool = false
$ignore_warning : bool = true
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

validateCompany()

Validate company data for one or more companyes.

public validateCompany(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

company data

Return values
array<string|int, mixed>

Search results