VariationSearchFactory

Concrete factory to build variation searches

Namespace

IO\Services\ItemSearch\Factories

Extends
Constants
Type Name Value Description

string

SORTING_ORDER_ASC

'asc'

string

SORTING_ORDER_DESC

'desc'

string

INHERIT_AGGREGATIONS

'aggregations'

string

INHERIT_COLLAPSE

'collapse'

string

INHERIT_EXTENSIONS

'extensions'

string

INHERIT_FILTERS

'filters'

string

INHERIT_MUTATORS

'mutators'

string

INHERIT_PAGINATION

'pagination'

string

INHERIT_RESULT_FIELDS

'resultFields'

string

INHERIT_SORTING

'sorting'

Properties
Type Name Description

``

$isAdminPreview

Methods
public __construct()
public isActive():Factories

Filter active variations

public isInactive():Factories

Filter inactive variations

public hasItemId($itemId):Factories

Filter variation by a single item id

Parameters

Type

Name

Description

int

$itemId

Item id to filter by.

public hasItemIds($itemIds):Factories

Filter variations by multiple item ids

Parameters

Type

Name

Description

array

$itemIds

List of item ids to filter by.

public hasVariationId($variationId):Factories

Filter variation by a single variation id.

Parameters

Type

Name

Description

int

$variationId

The variation id to filter by.

public hasVariationIds($variationIds):Factories

Filter variations by multiple variation ids.

Parameters

Type

Name

Description

array

$variationIds

List of variation ids to filter by.

public hasAtLeastOneAvailability($availabilityIds):Factories

Filter variations by multiple availability ids.

Parameters

Type

Name

Description

array

$availabilityIds

List of availability ids to filter by.

public hasSupplier($supplierId):Factories

Filter variations by multiple availability ids.

Parameters

Type

Name

Description

int

$supplierId

The supplier id to filter by.

public hasManufacturer($manufacturerId):Factories

Filter manufacturers by id.

Parameters

Type

Name

Description

int

$manufacturerId

To filter by manufacturer

public hasEachProperty($propertyIds):Factories

Filter variations by multiple property ids.

Parameters

Type

Name

Description

array

$propertyIds

The property ids to filter by.

public isMain():Factories

Filter only main variations

public isChild():Factories

Filter only child variations

public isHiddenInCategoryList($isHidden = true):Factories

Filter by visibility in category list.

Parameters

Type

Name

Description

bool

$isHidden

Visibility in category list to filter by.

public isSalable():Factories

Filter variations by isSalable flag

public isVisibleForClient($clientId = null):Factories

Filter variations by visibility for client

Parameters

Type

Name

Description

int

$clientId

The client id to filter by. If null, default client id on application will be used.

public hasNameInLanguage($type = \Plenty\Modules\Item\Search\Filter\TextFilter::FILTER_ANY_NAME, $lang = null):Factories

Filter variations having texts in a given language.

Parameters

Type

Name

Description

string

$type

The text field to filter by ('hasAny', 'hasName1', 'hasName2', 'hasName3')

string

$lang

The language to filter by. If null, language defined in session will be used.

public isInCategory($categoryId):Factories

Filter variations contained in a category.

Parameters

Type

Name

Description

int

$categoryId

A category id to filter variations by.

public hasAtLeastOnePrice($priceIds):Factories

Filter variations having at least on price.

Parameters

Type

Name

Description

array

$priceIds

List of price ids to filter variations by

public hasPriceForCustomer():Factories

Filter variations having at least one price accessible by current customer.

public hasPriceInRange()
public hasTag($tagId)
Parameters

Type

Name

Description

``

$tagId

public hasAnyTag($tagIds)
Parameters

Type

Name

Description

``

$tagIds

public groupByTemplateConfig($key = "ids.itemAttributeValue"):Factories

Group results depending on a config value.

Parameters

Type

Name

Description

string

$key

public isCrossSellingItem($itemId, $relation):Factories

Filter variations having a cross selling relation to a given item.

Parameters

Type

Name

Description

int

$itemId

Item id to filter cross selling items for

string

$relation

The relation of cross selling items.

public hasFacets($facetValues, $clientId = null, $lang = null):Factories

Filter variations by facets.

Parameters

Type

Name

Description

string | array

$facetValues

List of facet values. If string is given, it will be exploded by ';'

int

$clientId

Client id to filter facets by. If null, default client id from application will be used.

string

$lang

Language to filter facets by. If null, active language from session will be used.

public hasSearchString($query, $lang = null, $searchType = \Plenty\Modules\Cloud\ElasticSearch\Lib\ElasticSearch::SEARCH_TYPE_EXACT, $operator = \Plenty\Modules\Cloud\ElasticSearch\Lib\ElasticSearch::OR_OPERATOR):Factories

Filter variations by given search string.

Parameters

Type

Name

Description

string

$query

The search string to filter variations by

string

$lang

The language to apply search on. If null, default language from session will be used

string

$searchType

Type of the search ('exact', 'fuzzy', 'autocomplete')

string

$operator

Operator ot be used for search

public hasNameString($query, $lang = null):Factories

Filter variations by searching names

Parameters

Type

Name

Description

string

$query

The search string

string

$lang

Language to apply search on. If null, default language from session will be used.

public withLanguage($lang = null):Factories

Only request given language.

Parameters

Type

Name

Description

string

$lang

Language to get texts for. If null, default language from session will be used.

public withImages($clientId = null):Factories

Include images in result

Parameters

Type

Name

Description

int

$clientId

The client id to get images for. If null, default client id from application will be used.

public withAttributes():Factories

Includes VariatonAttributeMap for variation select

public withPropertyGroups()
public withOrderPropertySelectionValues()
public withVariationProperties()
public withUrls():Factories

Append URLs to result.

public withPrices($params):Factories

Append prices to result.

Parameters

Type

Name

Description

array

$params

Params to be passed to price search.

public withCurrentCategory():Factories

Set result as current category

public withDefaultImage():Factories

Append default item image if images are requested by result fields and item does not have any image

public withBundleComponents()
public withLinkToContent()
public withGroupedAttributeValues()
public withReducedResults($removeProperties = false)
Parameters

Type

Name

Description

``

$removeProperties

public withAvailability()
public withTags()