Documentation

Record extends BaseAction
in package

Webservice standard container - Get record detail class.

Table of Contents

$allowedHeaders  : array<string|int, mixed>
$allowedMethod  : array<string|int, string>
$controller  : Controller
$recordModel  : Vtiger_Record_Model
$responseType  : string
$userData  : array<string|int, mixed>
checkAction()  : void
Check called action.
delete()  : bool
Delete record.
get()  : array<string|int, mixed>
Get record detail.
getLanguage()  : string
Get current language.
getParentCrmId()  : int|null
Get parent record.
getPermissionType()  : int
Get permission type.
getUserCrmId()  : int
Get crmid for portal user.
getUserData()  : mixed
Get user data and session data.
getUserStorageId()  : int
Get user storage ID.
post()  : array<string|int, mixed>
Create record.
preProcess()  : mixed
Pre process function.
put()  : array<string|int, mixed>
Edit record.
setAllUserData()  : void
Set user data.
setUserData()  : void
Set user data.
updateSession()  : void
Update user session.
updateUser()  : void
Update user data.
checkLifetimeSession()  : void
Check lifetime user session.
checkPermission()  : void
Check permission to method.
checkPermissionToModule()  : void
Check permission to module.
loadSession()  : void
Load user session data .

Properties

$allowedHeaders

public array<string|int, mixed> $allowedHeaders = ['x-parent-id', 'x-fields-params']

Allowed headers

$allowedMethod

public array<string|int, string> $allowedMethod = ['GET', 'DELETE', 'PUT', 'POST']

Allowed methods

$responseType

public string $responseType = 'data'

Response data type.

$userData

private array<string|int, mixed> $userData = []

User data

Methods

checkAction()

Check called action.

public checkAction() : void
Tags
throws
Exception
Return values
void

delete()

Delete record.

public delete() : bool
Tags
OA\Delete

( path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}", description="Changes the state of a record, moving it to the trash", summary="Delete record", tags={"BaseModule"}, security={{"basicAuth" : }, "ApiKeyAuth" : }, "token" : }}}, @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"), @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116), @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true), @OA\Response( response=200, description="List of records moved to the trash", @OA\JsonContent(ref="#/components/schemas/BaseModule_Delete_Record_Response"), @OA\XmlContent(ref="#/components/schemas/BaseModule_Delete_Record_Response"), ), ),

OA\Schema

( schema="BaseModule_Delete_Record_Response", title="Base module - Transfer to the trash", description="List of records moved to the trash", type="object", required={"status", "result"}, @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"), @OA\Property(property="result", type="boolean", description="Status of successful transfer of the record to the recycle bin"), ),

Return values
bool

get()

Get record detail.

public get() : array<string|int, mixed>
Tags
OA\Get

( path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}", description="Gets the details of a record", summary="Data for the record", tags={"BaseModule"}, security={{"basicAuth" : }, "ApiKeyAuth" : }, "token" : }}}, operationId="getRecord", @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"), @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116), @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true), @OA\Parameter(name="x-raw-data", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Gets raw data", required=false, example=1), @OA\Parameter(name="x-parent-id", in="header", @OA\Schema(type="integer"), description="Parent record id", required=false, example=5), @OA\Parameter(name="x-fields-params", in="header", description="JSON array - list of fields to be returned in the specified way", required=false, @OA\JsonContent(ref="#/components/schemas/Fields-Settings"), ), @OA\Response( response=200, description="Gets data for the record", @OA\JsonContent(ref="#/components/schemas/BaseModule_Get_Record_Response"), @OA\XmlContent(ref="#/components/schemas/BaseModule_Get_Record_Response"), ), @OA\Response( response=403, description="No permissions to remove record OR No permissions to view record OR No permissions to edit record", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), @OA\Response( response=404, description="No record id OR Record doesn't exist", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), ),

OA\Schema

( schema="Fields-Settings", title="Custom field settings", description="A list of custom parameters that can affect the return value of a given field.", type="object", example={"password" : {"showHiddenData" : true}} ),

OA\Schema

( schema="BaseModule_Get_Record_Response", title="Base module - Response body for Record", type="object", required={"status", "result"}, @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"), @OA\Property( property="result", title="Record data", type="object", required={"name", "id", "fields", "data"}, @OA\Property(property="name", description="Record name", type="string", example="Driving school"), @OA\Property(property="id", description="Record Id", type="integer", example=152), @OA\Property(property="fields", type="object", title="System field names and field labels", example={"field_name_1" : "Field label 1", "field_name_2" : "Field label 2", "assigned_user_id" : "Assigned user", "createdtime" : "Created time"}, @OA\AdditionalProperties(type="string", description="Field label"), ), @OA\Property(property="data", title="Record data", type="object", ref="#/components/schemas/Record_Display_Details"), @OA\Property( property="privileges", title="Parameters determining checking of editing rights and moving to the trash", type="object", required={"isEditable", "moveToTrash"}, @OA\Property(property="isEditable", description="Check if record is editable", type="boolean", example=true), @OA\Property(property="moveToTrash", description="Permission to delete", type="boolean", example=false), ), @OA\Property(property="inventory", description="Value inventory data", type="object"), @OA\Property(property="summaryInventory", description="Value summary inventory data", type="object"), @OA\Property(property="rawData", description="Raw record data", type="object", ref="#/components/schemas/Record_Raw_Details"), @OA\Property(property="rawInventory", description="Inventory data", type="object"), ), ),

Return values
array<string|int, mixed>

getLanguage()

Get current language.

public getLanguage() : string
Return values
string

getParentCrmId()

Get parent record.

public getParentCrmId() : int|null
Tags
throws
Exception
Return values
int|null

getPermissionType()

Get permission type.

public getPermissionType() : int
Return values
int

getUserCrmId()

Get crmid for portal user.

public getUserCrmId() : int
Return values
int

getUserData()

Get user data and session data.

public getUserData(string $key[, string $param = '' ]) : mixed
Parameters
$key : string
$param : string = ''
Return values
mixed

getUserStorageId()

Get user storage ID.

public getUserStorageId() : int
Return values
int

post()

Create record.

public post() : array<string|int, mixed>
Tags
OA\Post

( path="/webservice/WebserviceStandard/{moduleName}/Record", description="Create new record", summary="Create record", tags={"BaseModule"}, security={{"basicAuth" : }, "ApiKeyAuth" : }, "token" : }}}, @OA\RequestBody( required=true, description="Contents of the request contains an associative array with the data record.", @OA\JsonContent(ref="#/components/schemas/Record_Edit_Details"), @OA\XmlContent(ref="#/components/schemas/Record_Edit_Details"), ), @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"), @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true), @OA\Response( response=200, description="Contents of the response contains only id", @OA\JsonContent(ref="#/components/schemas/BaseModule_Post_Record_Response"), @OA\XmlContent(ref="#/components/schemas/BaseModule_Post_Record_Response"), @OA\Link(link="GetRecordById", ref="#/components/links/GetRecordById") ), @OA\Response( response=406, description="No input data", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), ),

OA\Schema

( schema="BaseModule_Post_Record_Response", title="Base module - Created records", description="Contents of the response contains only id", type="object", required={"status", "result"}, @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"), @OA\Property(property="result", type="object", title="Record data", description="Created record id and name.", required={"id", "name"}, @OA\Property(property="id", type="integer", description="Id of the newly created record", example=22), @OA\Property(property="name", type="string", description="Id of the newly created record", example="YetiForce Name"), @OA\Property(property="skippedData", type="object", description="List of parameters passed in the request that were skipped in the write process"), ), ),

OA\Link

( link="GetRecordById", description="The id value returned in the response can be used as the recordId parameter in GET /webservice/{moduleName}/Record/{recordId}.", operationId="getRecord", parameters={ "recordId" = "$response.body#/result/id" } )

Return values
array<string|int, mixed>

preProcess()

Pre process function.

public preProcess() : mixed
Return values
mixed

put()

Edit record.

public put() : array<string|int, mixed>
Tags
OA\Put

( path="/webservice/WebserviceStandard/{moduleName}/Record/{recordId}", description="Retrieves data for editing a record", summary="Edit record", tags={"BaseModule"}, security={{"basicAuth" : }, "ApiKeyAuth" : }, "token" : }}}, @OA\RequestBody( required=true, description="Contents of the request contains an associative array with the data record.", @OA\JsonContent(ref="#/components/schemas/Record_Edit_Details"), @OA\XmlContent(ref="#/components/schemas/Record_Edit_Details"), ), @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Contacts"), @OA\Parameter(name="recordId", in="path", @OA\Schema(type="integer"), description="Record id", required=true, example=116), @OA\Parameter(name="X-ENCRYPTED", in="header", @OA\Schema(ref="#/components/schemas/Header-Encrypted"), required=true), @OA\Response( response=200, description="Contents of the response contains only id", @OA\JsonContent(ref="#/components/schemas/BaseModule_Put_Record_Response"), @OA\XmlContent(ref="#/components/schemas/BaseModule_Put_Record_Response"), @OA\Link(link="GetRecordById", ref="#/components/links/GetRecordById") ), @OA\Response( response=406, description="No input data", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), ),

OA\Schema

( schema="BaseModule_Put_Record_Response", title="Base module - Response body for Record", description="Contents of the response contains only id", type="object", required={"status", "result"}, @OA\Property(property="status", type="integer", enum={0, 1}, description="A numeric value of 0 or 1 that indicates whether the communication is valid. 1 - success , 0 - error"), @OA\Property(property="result", type="object", title="Record data", description="Created record id and name.", required={"id", "name"}, @OA\Property(property="id", type="integer", description="Id of the newly created record", example=22), @OA\Property(property="name", type="string", description="Id of the newly created record", example="YetiForce Name"), @OA\Property(property="skippedData", type="object", description="List of parameters passed in the request that were skipped in the write process"), ), ),

OA\Schema

( schema="Record_Edit_Details", title="General - Record edit details", description="Record data in user format for edit view", type="object", example={"field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : 1, "createdtime" : "2014-09-24 20:51:12"}, ),

OA\Schema

( schema="Record_Raw_Details", title="General - Record raw details", description="Record data in the system format as stored in a database", type="object", example={"id" : 11, "field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : 1, "createdtime" : "2014-09-24 20:51:12"}, ),

OA\Schema

( schema="Record_Display_Details", title="General - Record display details", description="Record data in user format for preview", type="object", example={"id" : 11, "field_name_1" : "Tom", "field_name_2" : "Kowalski", "assigned_user_id" : "YetiForce Administrator", "createdtime" : "2014-09-24 20:51"}, ),

Return values
array<string|int, mixed>

setAllUserData()

Set user data.

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

setUserData()

Set user data.

public setUserData(string $key, mixed $value) : void
Parameters
$key : string
$value : mixed
Return values
void

updateSession()

Update user session.

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

updateUser()

Update user data.

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

checkLifetimeSession()

Check lifetime user session.

protected checkLifetimeSession() : void
Tags
throws
Exception
Return values
void

checkPermission()

Check permission to method.

protected checkPermission() : void
Return values
void

checkPermissionToModule()

Check permission to module.

protected checkPermissionToModule() : void
Tags
throws
Exception
Return values
void

loadSession()

Load user session data .

protected loadSession() : void
Tags
throws
Exception
Return values
void

        

Search results