Record
extends Base
in package
Record class to synchronization.
Table of Contents
- $accountFieldsMap : array<string|int, string>
- Account fields map .
- $config : Config
- Config.
- $controller : Controller
- Controller.
- $lastScan : array<string|int, mixed>
- Last scan config data.
- $connector : Token
- Connector.
- __construct() : mixed
- Constructor.
- findAccount() : int
- Find account record id by vat id or email fields.
- findAdditionalData() : array<string|int, mixed>
- Parse additional data.
- findByEmail() : int
- Find record id by email fields.
- findProduct() : int
- Find product id by ean.
- getFormattedTime() : string
- Return parsed time to magento time zone.
- getFromApi() : array<string|int, mixed>
- Get data by id from api.
- getSearchCriteria() : string
- Method to get search criteria Magento records.
- log() : void
- Add log to db.
- parseInventoryData() : array<string|int, mixed>
- Parse inventory data to YetiForce format.
- parseShippingData() : array<string|int, mixed>
- Parse shipping data.
- process() : void
- Main function.
- saveInventoryCrm() : bool
- Save inventory elements.
- syncAccount() : int
- Method to create/update account.
- syncContact() : int
- Method to create contact.
Properties
$accountFieldsMap
Account fields map .
public
array<string|int, string>
$accountFieldsMap
= ['email1' => 'email', 'phone' => 'phone', 'phone_extra' => 'phone_extra', 'fax' => 'mobile', 'fax_extra' => 'mobile_extra', 'buildingnumbera' => 'buildingnumbera', 'addresslevel1a' => 'addresslevel1a', 'addresslevel2a' => 'addresslevel2a', 'addresslevel3a' => 'addresslevel3a', 'addresslevel4a' => 'addresslevel4a', 'addresslevel5a' => 'addresslevel5a', 'addresslevel6a' => 'addresslevel6a', 'addresslevel7a' => 'addresslevel7a', 'addresslevel8a' => 'addresslevel8a', 'buildingnumberb' => 'buildingnumberb', 'addresslevel1b' => 'addresslevel1b', 'addresslevel2b' => 'addresslevel2b', 'addresslevel3b' => 'addresslevel3b', 'addresslevel4b' => 'addresslevel4b', 'addresslevel5b' => 'addresslevel5b', 'addresslevel6b' => 'addresslevel6b', 'addresslevel7b' => 'addresslevel7b', 'addresslevel8b' => 'addresslevel8b']
$config
Config.
public
Config
$config
$controller
Controller.
public
Controller
$controller
$lastScan
Last scan config data.
public
array<string|int, mixed>
$lastScan
= []
$connector
Connector.
protected
Token
$connector
Methods
__construct()
Constructor.
public
__construct(Controller $controller) : mixed
Parameters
- $controller : Controller
Return values
mixed —findAccount()
Find account record id by vat id or email fields.
public
findAccount(array<string|int, mixed> $data, Vtiger_Record_Model $recordModel) : int
Parameters
- $data : array<string|int, mixed>
- $recordModel : Vtiger_Record_Model
Return values
int —findAdditionalData()
Parse additional data.
public
findAdditionalData(Inventory $mapModel) : array<string|int, mixed>
Parameters
- $mapModel : Inventory
Return values
array<string|int, mixed> —findByEmail()
Find record id by email fields.
public
findByEmail(array<string|int, mixed> $data, Vtiger_Record_Model $recordModel) : int
Parameters
- $data : array<string|int, mixed>
- $recordModel : Vtiger_Record_Model
Return values
int —findProduct()
Find product id by ean.
public
findProduct(string $ean) : int
Parameters
- $ean : string
Return values
int —getFormattedTime()
Return parsed time to magento time zone.
public
getFormattedTime(string $value) : string
Parameters
- $value : string
Return values
string —getFromApi()
Get data by id from api.
public
getFromApi(string $type, string $id) : array<string|int, mixed>
Parameters
- $type : string
- $id : string
Return values
array<string|int, mixed> —getSearchCriteria()
Method to get search criteria Magento records.
public
getSearchCriteria([int $pageSize = 10 ]) : string
Parameters
- $pageSize : int = 10
Return values
string —log()
Add log to db.
public
log(string $category[, Throwable|null $ex = null ]) : void
Parameters
- $category : string
- $ex : Throwable|null = null
Return values
void —parseInventoryData()
Parse inventory data to YetiForce format.
public
parseInventoryData(Vtiger_Record_Model $recordModel, array<string|int, mixed> $item, Inventory $mapModel) : array<string|int, mixed>
Parameters
- $recordModel : Vtiger_Record_Model
- $item : array<string|int, mixed>
- $mapModel : Inventory
Return values
array<string|int, mixed> —parseShippingData()
Parse shipping data.
public
parseShippingData(Inventory $mapModel) : array<string|int, mixed>
Parameters
- $mapModel : Inventory
Return values
array<string|int, mixed> —process()
Main function.
public
abstract process() : void
Return values
void —saveInventoryCrm()
Save inventory elements.
public
saveInventoryCrm(Vtiger_Record_Model $recordModel, Inventory $mapModel) : bool
Parameters
- $recordModel : Vtiger_Record_Model
- $mapModel : Inventory
Return values
bool —syncAccount()
Method to create/update account.
public
syncAccount(array<string|int, mixed> $data) : int
Parameters
- $data : array<string|int, mixed>
Return values
int —syncContact()
Method to create contact.
public
syncContact(array<string|int, mixed> $data) : int
Parameters
- $data : array<string|int, mixed>