ItemService

Namespace

IO\Services

Properties
Type Name Description

Application

$app

ItemDataLayerRepositoryContract

$itemRepository

``

$sessionStorage

SessionStorageService

array

$additionalItemSortingMap

``

$cache

Methods
public __construct($app, $itemRepository, $sessionStorage)

ItemService constructor.

Parameters

Type

Name

Description

Application

$app

ItemDataLayerRepositoryContract

$itemRepository

SessionStorageService

$sessionStorage

public getItem($itemId):array

Get an item by ID

Parameters

Type

Name

Description

int

$itemId

public getItems($itemIds):array

Get a list of items with the specified item IDs

Parameters

Type

Name

Description

array

$itemIds

public getItemImage($itemId):string
Parameters

Type

Name

Description

int

$itemId

public getVariation($variationId):array

Get an item variation by ID

Parameters

Type

Name

Description

int

$variationId

public getVariations($variationIds):array

Get a list of item variations with the specified variation IDs

Parameters

Type

Name

Description

array

$variationIds

public getVariationList($itemId, $withPrimary = false):array
Parameters

Type

Name

Description

int

$itemId

bool

$withPrimary

public getVariationImage($variationId, $imageAccessor = "urlPreview"):string
Deprecated!

This method will not be supported in the future. Please refrain from using it as soon as possible.

Parameters

Type

Name

Description

int

$variationId

string

$imageAccessor

public getItemForCategory($catID, $params = [], $page = 1):array

Get all items for a specific category

Parameters

Type

Name

Description

int

$catID

array

$params

int

$page

public getVariationAttributeMap($itemId):array

List the attributes of an item variation

Parameters

Type

Name

Description

int

$itemId

public getVariationIsSalable($variationId):bool
Parameters

Type

Name

Description

int

$variationId

public getAttributeNameMap($itemId):array
Parameters

Type

Name

Description

int

$itemId

public getItemURL($itemId):Record
Deprecated!

Use UrlService instead

Get the item URL

Parameters

Type

Name

Description

int

$itemId

public getAttributeName($attributeId):string

Get the name of an attribute by ID

Parameters

Type

Name

Description

int

$attributeId

public getAttributeValueName($attributeValueId):string

Get the name of an attribute value by ID

Parameters

Type

Name

Description

int

$attributeValueId

public getItemCrossSellingList($itemId, $crossSellingType = "similar"):array

Get a list of cross-selling items for the specified item ID

Parameters

Type

Name

Description

int

$itemId

string

$crossSellingType

public getItemConditionText($conditionId):string
Parameters

Type

Name

Description

int

$conditionId

public getLatestItems($limit = 5, $categoryId):RecordList
Parameters

Type

Name

Description

int

$limit

int

$categoryId

public searchItems($searchString, $params = [], $page = 1):array
Parameters

Type

Name

Description

string

$searchString

array

$params

int

$page

public getAdditionalItemSorting()
public addAdditionalItemSorting($key, $translationKey)
Parameters

Type

Name

Description

string

$key

string

$translationKey

public fromMemoryCache()
public resetMemoryCache($key = null)
Parameters

Type

Name

Description

``

$key