AirLay backend

SubscriptionController extends ApiController
in package

Class ApiBaseController.

Table of Contents

$config  : AirlayConfig
$config  : AirlayConfig
$request  : Request
$user  : UserEntity
$status  : StatusPage|null
$tokenHandler  : TokenHandler|null
__destruct()  : mixed
afterExecuteRoute()  : mixed
beforeExecuteRoute()  : mixed
confirmAction()  : string
Confirm subscribe.
createAction()  : string
Create subscription for user.
deleteAction()  : string
Delete users subscription.
getAction()  : string
Get users subscription request( 'method' => 'GET', 'url' => '/api/v4/subscription/get', 'params' => [ ] ) response( '200' => [ 'status' => 200, 'message' => SubscriptionEntity[], 'code' => 0 ] )
getAllAction()  : string
Get subscription bu user organization request( 'method' => 'GET', 'url' => '/api/v4/subscription/getAll', 'params' => [ ] ) response( '200' => [ 'status' => 200, 'message' => SubscriptionEntity[], 'code' => 0 ] )
indexAction()  : mixed
initialize()  : void
inviteAction()  : string
Invite user in subscription.
rejectAction()  : string
Reject subscribe.
removeUserAction()  : string
Remove user from subscription.
unsubscribeAction()  : string
Unsubscribe.
updateAction()  : string
Update users subscription.
attachTmpFile()  : Response
firesAnRelationUpdateEvents()  : void
getId()  : mixed
getNormalizedUserId()  : int|ObjectId
getTranslator()  : NativeArray
getUserInfo()  : UserEntity
secureData()  : mixed
sendEmail()  : mixed

Properties

Methods

afterExecuteRoute()

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

beforeExecuteRoute()

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

confirmAction()

Confirm subscribe.

public confirmAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/subscription/confirm' 'params' => [ [ 'name' => 'id', 'type' => 'objectId', 'description' => 'Subscription id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => 'OK', 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

createAction()

Create subscription for user.

public createAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/subscription/create' 'params' => [ [ 'name' => 'dataSetIds', 'type' => 'arrayObjectId', 'description' => 'Array dataSet ids', 'required' => true ], [ 'name' => 'report', 'type' => 'json', 'description' => 'Subscription report', 'required' => true ], [ 'name' => 'period', 'type' => 'day' | 'week' | 'month', 'description' => 'Period of sending messages', 'required' => true ] ] ]) response([ 'status' => 'OK', 'message' => SubscriptionEntity, 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

deleteAction()

Delete users subscription.

public deleteAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/subscription/delete' 'params' => [ [ 'name' => 'id', 'type' => 'objectId', 'description' => 'Subscription id', 'required' => false ] ] ]) response([ 'status' => 200, 'message' => 'OK', 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

getAction()

Get users subscription request( 'method' => 'GET', 'url' => '/api/v4/subscription/get', 'params' => [ ] ) response( '200' => [ 'status' => 200, 'message' => SubscriptionEntity[], 'code' => 0 ] )

public getAction() : string
Return values
string

getAllAction()

Get subscription bu user organization request( 'method' => 'GET', 'url' => '/api/v4/subscription/getAll', 'params' => [ ] ) response( '200' => [ 'status' => 200, 'message' => SubscriptionEntity[], 'code' => 0 ] )

public getAllAction() : string
Return values
string

inviteAction()

Invite user in subscription.

public inviteAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/subscription/invited' 'params' => [ [ 'name' => 'id', 'type' => 'objectId', 'description' => 'Subscription id', 'required' => true ], [ 'name' => 'userId', 'type' => 'objectId', 'description' => 'User id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => 'OK', 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

rejectAction()

Reject subscribe.

public rejectAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/subscription/reject' 'params' => [ [ 'name' => 'id', 'type' => 'objectId', 'description' => 'Subscription id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => 'OK', 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

removeUserAction()

Remove user from subscription.

public removeUserAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/subscription/removeUser' 'params' => [ [ 'name' => 'id', 'type' => 'objectId', 'description' => 'Subscription id', 'required' => true ], [ 'name' => 'userId', 'type' => 'objectId', 'description' => 'User id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => 'OK', 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

unsubscribeAction()

Unsubscribe.

public unsubscribeAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/subscription/unsubscribe' 'params' => [ [ 'name' => 'id', 'type' => 'objectId', 'description' => 'Subscription id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => 'OK', 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

updateAction()

Update users subscription.

public updateAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/subscription/update' 'params' => [ [ 'name' => 'id', 'type' => 'objectId', 'description' => 'Subscription id', 'required' => true ], [ 'name' => 'name', 'type' => 'string', 'description' => 'Subscription name', 'required' => false ], [ 'name' => 'period', 'type' => 'day' | 'week' | 'month', 'description' => 'Period of sending messages', 'required' => false ] ] ]) response([ 'status' => 200, 'message' => 'OK', 'code' => 0 ])

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

Search results