AirLay backend

TrackerController extends TrackerController
in package

Class TrackerController

Table of Contents

$config  : AirlayConfig
$config  : AirlayConfig
$request  : Request
$user  : UserEntity
$status  : StatusPage|null
$tokenHandler  : TokenHandler|null
__destruct()  : mixed
addGroupAction()  : string
Add group to tracker request([ 'method' => 'POST', 'url' => '/api/v3/tracker/addGroup' 'params' => [ [ 'name' => 'id', 'type' => 'ObjectId', 'description' => 'tracker id', 'required' => true ], [ 'name' => 'groupId', 'type' => 'ObjectId', 'description' => 'group id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TrackerEntity, 'code' => 0 ])
afterExecuteRoute()  : mixed
beforeExecuteRoute()  : mixed
checkArchive()  : bool
connectAction()  : string
dummy for backward compatibility request([ 'method' => 'POST', 'url' => '/api/v3/tracker/connect' ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])
createAction()  : string
Create tracker request([ 'method' => 'POST', 'url' => '/api/v3/tracker/create' 'params' => [ [ 'name' => 'name', 'type' => 'string', 'description' => 'tracker name', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TrackerEntity, 'code' => 0 ])
deleteAction()  : string
Delete tracker by id request([ 'method' => 'POST', 'url' => '/api/v3/tracker/delete' 'params' => [ [ 'name' => 'id', 'type' => 'ObjectId', 'description' => 'tracker id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])
disconnectAction()  : string
dummy for backward compatibility request([ 'method' => 'POST', 'url' => '/api/v3/tracker/disconnect' ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])
getAction()  : string
Get trackers of the user's organization request( 'method' => 'GET', 'url' => '/api/v3/tracker/get' ) response( '200' => [ 'status' => 200, 'message' => TrackerEntity[] 'code' => 0 ] )
getCurrentAction()  : string
Get user trackers request( 'method' => 'GET', 'url' => '/api/v3/tracker/getCurrentAction' ) response( '200' => [ 'status' => 200, 'message' => TrackerEntity[] 'code' => 0 ] )
getTracksAction()  : false|string
Get tracks by filter: deviceId, bbox, layerId, begin, end.
indexAction()  : mixed
initialize()  : void
removeGroupAction()  : string
Remove group to tracker request([ 'method' => 'POST', 'url' => '/api/v3/tracker/removeGroup' 'params' => [ [ 'name' => 'id', 'type' => 'ObjectId', 'description' => 'tracker id', 'required' => true ], [ 'name' => 'groupId', 'type' => 'ObjectId', 'description' => 'group id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TrackerEntity, 'code' => 0 ])
sendAction()  : string
Send data to tracker module request([ 'method' => 'POST', 'url' => '/api/v3/tracker/send' 'params' => [ [ 'name' => 'type', 'type' => 'string', 'description' => 'object type', 'required' => true ], [ 'name' => 'json', 'type' => 'array', 'description' => 'json object', 'required' => true ], [ 'name' => 'schemeId', 'type' => 'ObjectId', 'description' => 'scheme object id if type object', 'required' => false ] ] ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])
sendLocationAction()  : string
Send location to tracker module request([ 'method' => 'POST', 'url' => '/api/v3/tracker/sendLocation' 'params' => [ [ 'name' => 'type', 'type' => 'string', 'description' => 'object type', 'required' => true ], [ 'name' => 'body', 'type' => 'array', 'description' => track object body ["lon" : float, "lat" : float, ("deviceId" : string (required : false))] | ["track" : ["point" : ["lon" : float, "lat" : float, "time" : int, ("deviceId" : string (required : false))], ...]], 'required' => true ] ] ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])
sendObjectAction()  : bool|string
Send object to tracker module request([ 'method' => 'POST', 'url' => '/api/v3/tracker/sendObject' 'params' => [ [ 'name' => 'body', 'type' => 'array', 'description' => 'object', 'required' => true ], [ 'name' => 'schemeId', 'type' => 'ObjectId', 'description' => 'scheme id', 'required' => true ], [ 'type' => 'File', 'description' => 'zip file', 'required' => false ] ] ]) response([ 'status' => 200, 'message' => ObjectId, 'code' => 0 ])
sendObjectToIssueAction()  : bool|string
Send object to issue request([ 'method' => 'POST', 'url' => '/api/v4/tracker/sendObjectToIssue' 'params' => [ [ 'name' => 'body', 'type' => 'array', 'description' => 'object', 'required' => true ], [ 'name' => 'schemeId', 'type' => 'ObjectId', 'description' => 'scheme id', 'required' => true ], [ 'type' => 'File', 'description' => 'zip file', 'required' => false ], [ 'name' => 'issueId', 'type' => 'objectId', 'description' => 'issue id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => FeatureEntity, 'code' => 0 ])
updateNameAction()  : string
Update tracker name request([ 'method' => 'POST', 'url' => '/api/v3/tracker/update' 'params' => [ [ 'name' => 'id', 'type' => 'ObjectId', 'description' => 'tracker id', 'required' => true ], [ 'name' => 'name', 'type' => 'string', 'description' => 'tracker name', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TrackerEntity, 'code' => 0 ])
attachTmpFile()  : Response
firesAnRelationUpdateEvents()  : void
getId()  : mixed
getNormalizedUserId()  : int|ObjectId
getTranslator()  : NativeArray
getUserInfo()  : UserEntity
secureData()  : mixed
sendEmail()  : mixed
sendObject()  : FeatureEntity|RelationEntity
getDeviceId()  : string
getMediaFile()  : File|null
insertTrack()  : void

Properties

Methods

addGroupAction()

Add group to tracker request([ 'method' => 'POST', 'url' => '/api/v3/tracker/addGroup' 'params' => [ [ 'name' => 'id', 'type' => 'ObjectId', 'description' => 'tracker id', 'required' => true ], [ 'name' => 'groupId', 'type' => 'ObjectId', 'description' => 'group id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TrackerEntity, 'code' => 0 ])

public addGroupAction() : string
Tags
throws
AirlayException
Return values
string

afterExecuteRoute()

public afterExecuteRoute(Dispatcher $dispatcher) : mixed
Parameters
$dispatcher : Dispatcher
Return values
mixed

beforeExecuteRoute()

public beforeExecuteRoute(Dispatcher $dispatcher) : mixed
Parameters
$dispatcher : Dispatcher
Return values
mixed

checkArchive()

public checkArchive(string $filename) : bool
Parameters
$filename : string
Return values
bool

connectAction()

dummy for backward compatibility request([ 'method' => 'POST', 'url' => '/api/v3/tracker/connect' ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])

public connectAction() : string
Return values
string

createAction()

Create tracker request([ 'method' => 'POST', 'url' => '/api/v3/tracker/create' 'params' => [ [ 'name' => 'name', 'type' => 'string', 'description' => 'tracker name', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TrackerEntity, 'code' => 0 ])

public createAction() : string
Tags
throws
AirlayException
Return values
string

deleteAction()

Delete tracker by id request([ 'method' => 'POST', 'url' => '/api/v3/tracker/delete' 'params' => [ [ 'name' => 'id', 'type' => 'ObjectId', 'description' => 'tracker id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])

public deleteAction() : string
Tags
throws
AirlayException
Return values
string

disconnectAction()

dummy for backward compatibility request([ 'method' => 'POST', 'url' => '/api/v3/tracker/disconnect' ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])

public disconnectAction() : string
Return values
string

getAction()

Get trackers of the user's organization request( 'method' => 'GET', 'url' => '/api/v3/tracker/get' ) response( '200' => [ 'status' => 200, 'message' => TrackerEntity[] 'code' => 0 ] )

public getAction() : string
Return values
string

getCurrentAction()

Get user trackers request( 'method' => 'GET', 'url' => '/api/v3/tracker/getCurrentAction' ) response( '200' => [ 'status' => 200, 'message' => TrackerEntity[] 'code' => 0 ] )

public getCurrentAction() : string
Return values
string

getTracksAction()

Get tracks by filter: deviceId, bbox, layerId, begin, end.

public getTracksAction() : false|string

Filters: deviceId - find by device id bbox - lat1, lat2, lon1, lon2, first point is top left bound, second point bottom right bound begin - start time in seconds end - end time in seconds request([ 'method' => 'GET', 'url' => '/api/v3/tracker/getTracks' 'params' => [ [ 'name' => 'deviceId', 'type' => 'string', 'description' => 'DeviceId', 'required' => true ], [ 'name' => 'begin', 'type' => 'int', 'required' => false, 'default' => 0 ], [ 'name' => 'end', 'type' => 'int', 'required' => false, 'default' => time() ] ] ]) response([ 'status' => 'OK', 'message' => array of tracks, 'code' => 0 ])

Tags
throws
AirlayException
Return values
false|string

removeGroupAction()

Remove group to tracker request([ 'method' => 'POST', 'url' => '/api/v3/tracker/removeGroup' 'params' => [ [ 'name' => 'id', 'type' => 'ObjectId', 'description' => 'tracker id', 'required' => true ], [ 'name' => 'groupId', 'type' => 'ObjectId', 'description' => 'group id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TrackerEntity, 'code' => 0 ])

public removeGroupAction() : string
Tags
throws
AirlayException
Return values
string

sendAction()

Send data to tracker module request([ 'method' => 'POST', 'url' => '/api/v3/tracker/send' 'params' => [ [ 'name' => 'type', 'type' => 'string', 'description' => 'object type', 'required' => true ], [ 'name' => 'json', 'type' => 'array', 'description' => 'json object', 'required' => true ], [ 'name' => 'schemeId', 'type' => 'ObjectId', 'description' => 'scheme object id if type object', 'required' => false ] ] ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])

public sendAction() : string
Tags
throws
AirlayException
Return values
string

sendLocationAction()

Send location to tracker module request([ 'method' => 'POST', 'url' => '/api/v3/tracker/sendLocation' 'params' => [ [ 'name' => 'type', 'type' => 'string', 'description' => 'object type', 'required' => true ], [ 'name' => 'body', 'type' => 'array', 'description' => track object body ["lon" : float, "lat" : float, ("deviceId" : string (required : false))] | ["track" : ["point" : ["lon" : float, "lat" : float, "time" : int, ("deviceId" : string (required : false))], ...]], 'required' => true ] ] ]) response([ 'status' => 200, 'message' => "Ok", 'code' => 0 ])

public sendLocationAction() : string
Tags
throws
AirlayException
Return values
string

sendObjectAction()

Send object to tracker module request([ 'method' => 'POST', 'url' => '/api/v3/tracker/sendObject' 'params' => [ [ 'name' => 'body', 'type' => 'array', 'description' => 'object', 'required' => true ], [ 'name' => 'schemeId', 'type' => 'ObjectId', 'description' => 'scheme id', 'required' => true ], [ 'type' => 'File', 'description' => 'zip file', 'required' => false ] ] ]) response([ 'status' => 200, 'message' => ObjectId, 'code' => 0 ])

public sendObjectAction() : bool|string
Tags
throws
AirlayException
Return values
bool|string

sendObjectToIssueAction()

Send object to issue request([ 'method' => 'POST', 'url' => '/api/v4/tracker/sendObjectToIssue' 'params' => [ [ 'name' => 'body', 'type' => 'array', 'description' => 'object', 'required' => true ], [ 'name' => 'schemeId', 'type' => 'ObjectId', 'description' => 'scheme id', 'required' => true ], [ 'type' => 'File', 'description' => 'zip file', 'required' => false ], [ 'name' => 'issueId', 'type' => 'objectId', 'description' => 'issue id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => FeatureEntity, 'code' => 0 ])

public sendObjectToIssueAction() : bool|string
Tags
throws
AirlayException
Return values
bool|string

updateNameAction()

Update tracker name request([ 'method' => 'POST', 'url' => '/api/v3/tracker/update' 'params' => [ [ 'name' => 'id', 'type' => 'ObjectId', 'description' => 'tracker id', 'required' => true ], [ 'name' => 'name', 'type' => 'string', 'description' => 'tracker name', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TrackerEntity, 'code' => 0 ])

public updateNameAction() : string
Tags
throws
AirlayException
Return values
string

firesAnRelationUpdateEvents()

protected firesAnRelationUpdateEvents(array<string|int, mixed> $relations, ObjectId $dataSetId[, DataSetLogEntity|null $log = null ]) : void
Parameters
$relations : array<string|int, mixed>
$dataSetId : ObjectId
$log : DataSetLogEntity|null = null
Return values
void

getTranslator()

protected getTranslator([string|null $language = null ]) : NativeArray
Parameters
$language : string|null = null
Tags
throws
Exception
Return values
NativeArray

secureData()

protected secureData(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

sendEmail()

protected sendEmail(string $email, string $name, string $subject, string $body) : mixed
Parameters
$email : string
$name : string
$subject : string
$body : string
Return values
mixed

getDeviceId()

private getDeviceId(array<string|int, mixed> $body) : string
Parameters
$body : array<string|int, mixed>
Tags
throws
AirlayException
Return values
string

insertTrack()

private insertTrack(string $deviceId, array<string|int, mixed> $body) : void
Parameters
$deviceId : string
$body : array<string|int, mixed>
Tags
throws
AirlayException
Return values
void

Search results