Documentation

RecordsTree extends RecordsList
in package

Portal container - Get product records tree detail class.

Table of Contents

$allowedHeaders  : array<string|int, mixed>
$allowedMethod  : array<string|int, string>
$controller  : Controller
$responseType  : string
$fields  : array<string|int, Vtiger_Field_Model>
$permissions  : array<string|int, mixed>
$queryGenerator  : QueryGenerator
$relatedFields  : array<string|int, mixed>
$userData  : array<string|int, mixed>
$isUserPermissions  : bool
Is user permissions.
$parentRecordModel  : Vtiger_Record_Model
Parent record model.
$permissionType  : int
Permission type.
checkAction()  : void
Check called action.
createQuery()  : void
Construct.
get()  : array<string|int, mixed>
Get record list method.
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.
preProcess()  : mixed
Pre process function.
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.
getColumnNames()  : array<string|int, mixed>
{@inheritdoc}
getRawDataFromRow()  : array<string|int, mixed>
{@inheritdoc}
getRecordFromRow()  : array<string|int, mixed>
{@inheritdoc}
isRawData()  : bool
{@inheritdoc}
loadSession()  : void
Load user session data .

Properties

$allowedHeaders

public array<string|int, mixed> $allowedHeaders = []

Allowed headers

$allowedMethod

public array<string|int, string> $allowedMethod

Allowed methods

$responseType

public string $responseType = 'data'

Response data type.

$fields

protected array<string|int, Vtiger_Field_Model> $fields = []

Fields models instance.

$permissions

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

Permissions.

$relatedFields

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

Related fields.

$userData

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

User data

$isUserPermissions

Is user permissions.

private bool $isUserPermissions

$permissionType

Permission type.

private int $permissionType

Methods

checkAction()

Check called action.

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

createQuery()

Construct.

public createQuery() : void
Tags
OA\Get

( path="/webservice/Portal/Products/RecordsTree", summary="Tree list of records", description="Get the tree list of records", tags={"Products"}, security={{"basicAuth" : }, "ApiKeyAuth" : }, "token" : }}}, @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-row-limit", in="header", @OA\Schema(type="integer"), description="Get rows limit, default: 1000", required=false, example=1000), @OA\Parameter(name="x-row-offset", in="header", @OA\Schema(type="integer"), description="Offset, default: 0", required=false, example=0), @OA\Parameter(name="x-order-by", in="header", description="Set the sorted results by columns [Json format]", required=false, @OA\JsonContent(type="object", title="Sort conditions", description="Multiple or one condition for a query generator", example={"field_name_1" : "ASC", "field_name_2" : "DESC"}, @OA\AdditionalProperties(type="string", title="Sort Direction", enum={"ASC", "DESC"}), ), ), @OA\Parameter(name="x-fields", in="header", description="JSON array in the list of fields to be returned in response", required=false, @OA\JsonContent(type="array", example={"field_name_1", "field_name_2"}, @OA\Items(type="string")), ), @OA\Parameter(name="x-condition", in="header", description="Conditions [Json format]", required=false, @OA\JsonContent(ref="#/components/schemas/Conditions-Mix-For-Query-Generator"), ), @OA\Parameter(name="x-parent-id", in="header", @OA\Schema(type="integer"), description="Parent record id", required=false, example=5), @OA\Response(response=200, description="List of entries", @OA\JsonContent(ref="#/components/schemas/Products_Get_RecordsList_Response"), @OA\XmlContent(ref="#/components/schemas/Products_Get_RecordsList_Response"), ), @OA\Response(response=400, description="Incorrect json syntax: x-fields", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), @OA\Response(response=401, description="No sent token, Invalid token, Token has expired", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), @OA\Response(response=403, description="No permissions for module", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), @OA\Response(response=405, description="Invalid method", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), ),

OA\Schema

( schema="Products_Get_RecordsList_Response", title="Products - Response action record list", description="Module action record list response body", 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="List of records", type="object", @OA\Property( property="headers", description="Column names", type="object", @OA\AdditionalProperties, ), @OA\Property( property="records", description="Records display details", type="object", @OA\AdditionalProperties(type="object", ref="#/components/schemas/Record_Display_Details"), ), @OA\Property( property="rawData", description="Records raw details", type="object", @OA\AdditionalProperties(type="object", ref="#/components/schemas/Record_Raw_Details"), ), @OA\Property(property="count", type="integer", example=54), @OA\Property(property="isMorePages", type="boolean", example=true), ), ),

Return values
void

get()

Get record list method.

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

( path="/webservice/RestApi/{moduleName}/RecordsList", description="Gets a list of records", summary="List of records", 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="x-raw-data", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Gets raw data", required=false, example=1), @OA\Parameter(name="x-row-limit", in="header", @OA\Schema(type="integer"), description="Get rows limit, default: 100", required=false, example=50), @OA\Parameter(name="x-row-offset", in="header", @OA\Schema(type="integer"), description="Offset, default: 0", required=false, example=0), @OA\Parameter(name="x-fields", in="header", description="JSON array in the list of fields to be returned in response", required=false, @OA\JsonContent(type="array", example={"field_name_1", "field_name_2"}, @OA\Items(type="string")), ), @OA\Parameter(name="x-condition", in="header", description="Conditions [Json format]", required=false, @OA\JsonContent(ref="#/components/schemas/Conditions-Mix-For-Query-Generator"), ), @OA\Parameter(name="x-only-column", in="header", @OA\Schema(type="integer", enum={0, 1}), description="Return only column names", 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-cv-id", in="header", @OA\Schema(type="integer"), description="Custom view ID", required=false, example=5), @OA\Parameter(name="x-order-by", in="header", description="Set the sorted results by columns [Json format]", required=false, @OA\JsonContent(type="object", title="Sort conditions", description="Multiple or one condition for a query generator", example={"field_name_1" : "ASC", "field_name_2" : "DESC"}, @OA\AdditionalProperties(type="string", title="Sort Direction", enum={"ASC", "DESC"}), ), ), @OA\Response(response=200, description="List of entries", @OA\JsonContent(ref="#/components/schemas/BaseModule_RecordsList_ResponseBody"), @OA\XmlContent(ref="#/components/schemas/BaseModule_RecordsList_ResponseBody"), ), @OA\Response(response=400, description="Incorrect json syntax: x-fields", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), @OA\Response(response=401, description="No sent token, Invalid token, Token has expired", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), @OA\Response(response=403, description="No permissions for module OR No permissions for custom view: x-cv-id", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), @OA\Response(response=405, description="Invalid method", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), ),

OA\Schema

( schema="BaseModule_RecordsList_ResponseBody", title="Base module - Response action record list", description="Module action record list response body", 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="List of records", required={"headers", "records", "permissions", "numberOfRecords", "isMorePages"}, @OA\Property(property="headers", type="object", title="Fields names", 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 name"), ), @OA\Property(property="records", type="object", title="Records display details", @OA\AdditionalProperties(type="object", ref="#/components/schemas/Record_Display_Details"), ), @OA\Property(property="permissions", type="object", title="Records action permissions", @OA\AdditionalProperties(type="object", title="Record action permissions", required={"isEditable", "moveToTrash"}, @OA\Property(property="isEditable", type="boolean", example=true), @OA\Property(property="moveToTrash", type="boolean", example=true), ), ), @OA\Property(property="rawData", type="object", title="Records raw details, dependent on the header x-raw-data", @OA\AdditionalProperties(type="object", ref="#/components/schemas/Record_Raw_Details"), ), @OA\Property(property="numberOfRecords", type="integer", description="Number of records on the page", example=20), @OA\Property(property="isMorePages", type="boolean", description="There are more pages", example=true), @OA\Property(property="numberOfAllRecords", type="integer", description="Number of all records, dependent on the header x-row-count", example=54), ), ),

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

preProcess()

Pre process function.

public preProcess() : mixed
Return values
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

getColumnNames()

{@inheritdoc}

protected getColumnNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRawDataFromRow()

{@inheritdoc}

protected getRawDataFromRow(array<string|int, mixed> $row) : array<string|int, mixed>
Parameters
$row : array<string|int, mixed>
Return values
array<string|int, mixed>

getRecordFromRow()

{@inheritdoc}

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

isRawData()

{@inheritdoc}

protected isRawData() : bool
Return values
bool

loadSession()

Load user session data .

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

        

Search results