AirLay backend

TemplateController 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
createAction()  : string
Create templates.
deleteAction()  : string
Delete template.
getAction()  : string
Get templates.
indexAction()  : mixed
initialize()  : void
updateAction()  : string
Update template.
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

createAction()

Create templates.

public createAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/templates/create' 'params' => [ [ 'name' => 'title', 'type' => 'string', 'description' => 'Template title', 'required' => true ], [ 'name' => 'type', 'type' => 'string', 'description' => 'Template type', 'required' => true ], [ 'name' => 'header', 'type' => 'string', 'description' => 'Template header', 'required' => true ], [ 'name' => 'body', 'type' => 'string', 'description' => 'Template body', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => TemplateEntity, 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

deleteAction()

Delete template.

public deleteAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/templates/delete' 'params' => [ [ 'name' => '_id', 'type' => 'ObjectId', 'description' => 'Template id', 'required' => true ] ] ]) response([ 'status' => 200, 'message' => 'OK', 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

getAction()

Get templates.

public getAction() : string

request([ 'method' => 'GET', 'url' => '/api/v4/templates/get' 'params' => [ [ 'name' => 'id', 'type' => 'objectId', 'description' => 'Template id', 'required' => false ] ] ]) response([ 'status' => 'OK', 'message' => TemplateEntity[], 'code' => 0 ])

Tags
throws
AirlayException
Return values
string

updateAction()

Update template.

public updateAction() : string

request([ 'method' => 'POST', 'url' => '/api/v4/templates/create' 'params' => [ [ 'name' => '_id', 'type' => 'objectId', 'description' => 'Template id', 'required' => true ],

        'name' => 'header',
        'type' => 'string',
        'description' => 'Template header',
        'required' => false
    ],
    [
        'name' => 'title',
        'type' => 'string',
        'description' => 'Template title',
        'required' => false
    ],
    [
        'name' => 'body',
        'type' => 'string',
        'description' => 'Template body',
        '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