Documentation

Record extends Record
in package

Portal container - Get product 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>
$isUserPermissions  : bool
$unitPrice  : float|null
checkAction()  : void
Check called action.
delete()  : bool
Delete record.
get()  : array<string|int, mixed>
Get record detail.
getCheckStockLevels()  : bool
Get information, whether to check inventory levels.
getLanguage()  : string
Get current language.
getParentCrmId()  : int
Get parent record.
getPermissionType()  : int
Get permission type.
getUserCrmId()  : int
Get crmid for portal user.
getUserData()  : mixed
Get user 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.
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 .
getProductBundles()  : array<string|int, mixed>
Get product bundles.
getRecordFromRow()  : array<string|int, mixed>
Get record from row.
getUnitGross()  : float
Get unit gross.
getUnitPrice()  : float
Get unit price.

Properties

$allowedHeaders

public array<string|int, mixed> $allowedHeaders = ['x-parent-id', 'x-unit-price', 'x-unit-gross', 'x-product-bundles']

Allowed headers

$allowedMethod

public array<string|int, string> $allowedMethod

Allowed methods

$responseType

public string $responseType = 'data'

Response data type.

$userData

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

User data

$isUserPermissions

private bool $isUserPermissions

Is user permissions.

$unitPrice

private float|null $unitPrice

Unit price.

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/RestApi/{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/Portal/Products/Record/{recordId}", summary="Data for the product", description="Gets the details of a product", tags={"Products"}, security={{"basicAuth" : }, "ApiKeyAuth" : }, "token" : }}}, @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-unit-price", description="Get additional unit price", @OA\Schema(type="integer", enum={0, 1}), in="header", example=1, required=false ), @OA\Parameter( name="x-unit-gross", description="Get additional unit gross", @OA\Schema(type="integer", enum={0, 1}), in="header", example=1, required=false ), @OA\Parameter( name="x-product-bundles", description="Get additional product bundles", @OA\Schema(type="integer", enum={0, 1}), in="header", example=1, required=false ), @OA\Response( response=200, description="Gets data for the record", @OA\JsonContent(ref="#/components/schemas/Products_Get_Record_Response"), @OA\XmlContent(ref="#/components/schemas/Products_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="Products_Get_Record_Response", title="Base module - Response body for Record", type="object", @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", description="Record data", type="object", @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", description="Record data", type="object", ref="#/components/schemas/Record_Display_Details", ), @OA\Property( property="privileges", description="Parameters determining checking of editing rights and moving to the trash", type="object", @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="rawData", type="object", description="Raw record data", ref="#/components/schemas/Record_Raw_Details"), @OA\Property( property="productBundles", description="Product bundles", type="object", @OA\AdditionalProperties( description="Product", type="object", @OA\Property(property="data", type="object", description="Record data", ref="#/components/schemas/Record_Raw_Details"), @OA\Property(property="rawData", type="object", description="Raw record data", ref="#/components/schemas/Record_Raw_Details"), ), ), @OA\Property( property="ext", description="Product bundles", type="object", @OA\Property(property="unit_price", description="Unit price", type="integer", example=44), @OA\Property(property="unit_gross", description="Unit gross", type="integer", example=55), @OA\Property(property="qtyinstock", description="Qty In Stock", type="integer", example=66), ), ), ),

Return values
array<string|int, mixed>

getCheckStockLevels()

Get information, whether to check inventory levels.

public getCheckStockLevels() : bool
Return values
bool

getLanguage()

Get current language.

public getLanguage() : string
Return values
string

getParentCrmId()

Get parent record.

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

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.

public getUserData(string $key) : mixed
Parameters
$key : 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/RestApi/{moduleName}/Record", description="Gets data to save 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\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/RestApi/{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\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>

setUserData()

Set user data.

public setUserData(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, 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
Tags
throws
Exception
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

getProductBundles()

Get product bundles.

private getProductBundles() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRecordFromRow()

Get record from row.

private getRecordFromRow(array<string|int, mixed> $row, array<string|int, Vtiger_Field_Model$fieldsModel) : array<string|int, mixed>
Parameters
$row : array<string|int, mixed>
$fieldsModel : array<string|int, Vtiger_Field_Model>
Return values
array<string|int, mixed>

getUnitGross()

Get unit gross.

private getUnitGross(array<string|int, mixed> $response) : float
Parameters
$response : array<string|int, mixed>
Return values
float

getUnitPrice()

Get unit price.

private getUnitPrice(array<string|int, mixed> $response) : float
Parameters
$response : array<string|int, mixed>
Return values
float

        

Search results