Documentation

SaveInventory extends BaseAction
in package

Saving data to the inventory module.

Table of Contents

$allowedHeaders  : array<string|int, mixed>
$allowedMethod  : array<string|int, string>
$controller  : Controller
$responseType  : string
$userData  : array<string|int, mixed>
$inventory  : Inventory
$moduleModel  : Vtiger_Module_Model
$moduleName  : string
$recordModel  : Vtiger_Record_Model
checkAction()  : void
Check called action.
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 inventory record.
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.
loadSession()  : void
Load user session data .
checkBeforeSave()  : array<string|int, mixed>
Check the request before the save.

Properties

$allowedHeaders

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

Allowed headers

$allowedMethod

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

Allowed methods

$responseType

public string $responseType = 'data'

Response data type.

$userData

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

User data

$moduleModel

private Vtiger_Module_Model $moduleModel

Module model.

Methods

checkAction()

Check called action.

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

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 inventory record.

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

( path="/webservice/Portal/{moduleName}/SaveInventory", summary="Add inventory record from cart", description="Creating inventory records for the functionality of the store", tags={"BaseModule"}, security={{"basicAuth" : }, "ApiKeyAuth" : }, "token" : }}}, @OA\Parameter(name="moduleName", in="path", @OA\Schema(type="string"), description="Module name", required=true, example="Accounts"), @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 nd module name", @OA\JsonContent(ref="#/components/schemas/BaseAction_SaveInventory_ResponseBody"), @OA\XmlContent(ref="#/components/schemas/BaseAction_SaveInventory_ResponseBody"), ), @OA\Response( response=403, description="No permissions to create record", @OA\JsonContent(ref="#/components/schemas/Exception"), @OA\XmlContent(ref="#/components/schemas/Exception"), ), ),

OA\Schema

( schema="BaseAction_SaveInventory_ResponseBody", title="Base module - Create inventory record response schema", 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="Create result", type="object", oneOf={ @OA\Schema(ref="#/components/schemas/BaseAction_SaveInventory_ResponseBodySuccess"), @OA\Schema(ref="#/components/schemas/BaseAction_SaveInventory_ResponseBodyError"), } ), ),

OA\Schema

( schema="BaseAction_SaveInventory_ResponseBodySuccess", title="Base module - Create inventory record response success schema", @OA\Property(property="id", description="Record Id", type="integer", example=38), @OA\Property(property="moduleName", type="string", example="SSingleOrders"), ),

OA\Schema

( schema="BaseAction_SaveInventory_ResponseBodyError", title="Base module - Create inventory record response error schema", type="object", @OA\Property(property="errors", description="Error details", type="object"), ),

Return values
array<string|int, mixed>

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
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

checkBeforeSave()

Check the request before the save.

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

        

Search results