class ErpCacheUtil

Class ErpCacheUtil - Helper class designed to provide cached data from database

Methods

__construct(ContainerInterface $container)

ErpCacheUtil constructor.

array
setAllProductsIdAndCode(string $filename = ERPTmpFiles::PRODUCT_ID_AND_ERP_CODES_FILE_PATH)

Get all erp codes and ids of products Use file as cache, if there is no file create one

array
addDataToFile(mixed $data, mixed $filename, mixed $variableName, bool $preserveKeys = false, mixed $rowFunction = null)

Add data to cache file

array
setAllProductsRelationships(mixed $data, mixed $filename, mixed $variableName)

Create add read cache file for product relationships

array
getAllProductCodes()

Get all erp codes of products Use file as cache, if there is no file create one

array
getSimpleCodeErpCodes()

Cache data of ids of simple product for given product erp code Use file as cache, if there is no file create one

array
getAllAttributeSetsCodes(bool $shouldCacheAgain = false)

Get all erp codes of attribute sets Use file as cache, if there is no file create one

array
getAllAttributeCodes(bool $shouldCacheAgain = false)

Get all erp codes of attributes Use file as cache, if there is no file create one

array
getAllAttributeValueCodes(bool $shouldCacheAgain = false)

Get all erp codes of attribute values Use file as cache, if there is no file create one

array
getAllProductAttributeValueCodes(bool $shouldCacheAgain = false)

Get all erp codes of product attribute values Use file as cache, if there is no file create one

array
getAllCategoriesIdAndCode()

Get id and erp code of all categories Use file as cache, if there is no file create one

array
getAllBrandIdsAndCodes()

Get id and erp code of all brands Use file as cache, if there is no file create one

createArrayCacheFile(array $dataArray, string $variableName, string $path, mixed $rowFunction)

Create file to use as cache and set array in it

array
getAllProductPrices()

Get list of all product prices Use file as cache, if there is no file create one

array
getUserErpCodeToIdArray()

Get list of all users id and erp codes Use file as cache, if there is no file create one

array
getAllUsersShippingAddressesArray()

Get list of all users shipping addresses Use file as cache, if there is no file create one

array
getUnitsOfMeasureArray()

Get list of all units of measure Use file as cache, if there is no file create one

array
getUnsyncedErpOrderIds(mixed $page = 1, mixed $offset = 10)

Get list of all orders that are not synced with erp

Details

at line 85
__construct(ContainerInterface $container)

ErpCacheUtil constructor.

Parameters

ContainerInterface $container

at line 108
array setAllProductsIdAndCode(string $filename = ERPTmpFiles::PRODUCT_ID_AND_ERP_CODES_FILE_PATH)

Get all erp codes and ids of products Use file as cache, if there is no file create one

Parameters

string $filename

Return Value

array

Exceptions

Exception

at line 140
array addDataToFile(mixed $data, mixed $filename, mixed $variableName, bool $preserveKeys = false, mixed $rowFunction = null)

Add data to cache file

Parameters

mixed $data
mixed $filename
mixed $variableName
bool $preserveKeys
mixed $rowFunction

Return Value

array

Exceptions

Exception

at line 183
array setAllProductsRelationships(mixed $data, mixed $filename, mixed $variableName)

Create add read cache file for product relationships

Parameters

mixed $data
mixed $filename
mixed $variableName

Return Value

array

Exceptions

Exception

at line 238
array getAllProductCodes()

Get all erp codes of products Use file as cache, if there is no file create one

Return Value

array

Exceptions

Exception

at line 265
array getSimpleCodeErpCodes()

Cache data of ids of simple product for given product erp code Use file as cache, if there is no file create one

Return Value

array

Exceptions

Exception

at line 299
array getAllAttributeSetsCodes(bool $shouldCacheAgain = false)

Get all erp codes of attribute sets Use file as cache, if there is no file create one

Parameters

bool $shouldCacheAgain

Return Value

array

Exceptions

Exception

at line 333
array getAllAttributeCodes(bool $shouldCacheAgain = false)

Get all erp codes of attributes Use file as cache, if there is no file create one

Parameters

bool $shouldCacheAgain

Return Value

array

Exceptions

Exception

at line 367
array getAllAttributeValueCodes(bool $shouldCacheAgain = false)

Get all erp codes of attribute values Use file as cache, if there is no file create one

Parameters

bool $shouldCacheAgain

Return Value

array

Exceptions

Exception

at line 401
array getAllProductAttributeValueCodes(bool $shouldCacheAgain = false)

Get all erp codes of product attribute values Use file as cache, if there is no file create one

Parameters

bool $shouldCacheAgain

Return Value

array

Exceptions

Exception

at line 435
array getAllCategoriesIdAndCode()

Get id and erp code of all categories Use file as cache, if there is no file create one

Return Value

array

Exceptions

Exception

at line 469
array getAllBrandIdsAndCodes()

Get id and erp code of all brands Use file as cache, if there is no file create one

Return Value

array

Exceptions

Exception

at line 501
createArrayCacheFile(array $dataArray, string $variableName, string $path, mixed $rowFunction)

Create file to use as cache and set array in it

Parameters

array $dataArray
  • data to be saved
string $variableName
  • key to which data will be added
string $path
  • path of new file
mixed $rowFunction
  • function that creates string for every row od data

at line 524
array getAllProductPrices()

Get list of all product prices Use file as cache, if there is no file create one

Return Value

array

Exceptions

Exception

at line 558
array getUserErpCodeToIdArray()

Get list of all users id and erp codes Use file as cache, if there is no file create one

Return Value

array

Exceptions

Exception

at line 594
array getAllUsersShippingAddressesArray()

Get list of all users shipping addresses Use file as cache, if there is no file create one

Return Value

array

Exceptions

Exception

at line 627
array getUnitsOfMeasureArray()

Get list of all units of measure Use file as cache, if there is no file create one

Return Value

array

Exceptions

Exception

at line 649
array getUnsyncedErpOrderIds(mixed $page = 1, mixed $offset = 10)

Get list of all orders that are not synced with erp

Parameters

mixed $page
mixed $offset

Return Value

array