ExternalSearch

Helper class to allow searches from external plugins.

Namespace

Ceres\Helper

Constants
Type Name Value Description

string

EVENT_NAME

'Ceres.Search.Query'

Properties
Type Name Description

string

$searchString

The search string

int

$categoryId

Category id to search items for (Default: 0)

int

$page

What page to get (Default: 1)

int

$itemsPerPage

How many items per page (Default: 20)

string

$sorting

How should the result be sorted

array

$results

The result of the search, an array of variation ids

int

$countTotal

Amount of results

bool

$hasResults

Is there a result?

Methods
public static getExternalResults($container):mixed

Perform the external search

Parameters

Type

Name

Description

ExternalSearch

$container

An ExternalSearch object

public static hasExternalSearch():bool

Check if there is an external search plugin?

public setResults($variationIds, $countTotal = null)

Set the results of the external search

Parameters

Type

Name

Description

array

$variationIds

The variation ids found by the search

int

$countTotal

Optional: The amount of found variation ids

public hasResults():bool

Return true if the search has a result

public getResults():array

Return the results of the search

public getCountTotal():int

The amount of found variations