package Core
subpackage Helper This class contains functions for the category helper class in CONTENIDO.

 Methods

Fetchs the level of a category by a given category ID.

getCategoryLevel(int $categoryId) : int

Parameters

$categoryId

int

Category ID to fetch the level of.

Returns

intcategory level

Returns an array with ordered cApiCategoryLanguage objects e.g.

getCategoryPath(int $categoryId, int $startingLevel, int $maxDepth) : array

for a breadcrumb.

Parameters

$categoryId

int

Last category ID in list.

$startingLevel

int

Define here, at which level the list should start. (optional, default: 1)

$maxDepth

int

Amount of the max depth of categories. (optional, default: 20)

Returns

arrayArray with cApiCategoryLanguage objects

Returns the local stored client ID

getClientId() : int

Returns

intclient ID

Returns the instance of this class.

getInstance() : \cCategoryHelper
Static

Returns the local stored language ID

getLanguageId() : int

Returns

intlanguage ID

Fetch all parent category IDs of a given category.

getParentCategoryIds(int $categoryId, int $maxDepth) : array

Parameters

$categoryId

int

Base category to search on.

$maxDepth

int

Amount of the max depth of categories. (optional, default: 20)

Returns

arrayArray with parent category IDs.

Return the subcategories of the given category ID.

getSubCategories(int $categoryId, int $depth) : array

Parameters

$categoryId

int

ID of the category to load

$depth

int

the maximum depth

Returns

arrayarray with subcategories

Return the ID of the top most category based on a given category ID.

getTopMostCategoryId(int $categoryId) : int

Parameters

$categoryId

int

Base category ID to search on

Returns

intTop most category ID

Checks if set auth object has access to the specific category.

hasCategoryAccess(\cApiCategoryLanguage $categoryLanguage) : bool

Parameters

$categoryLanguage

\cApiCategoryLanguage

category language object

Returns

boolresult of access check

Sets an auth object to use on category access check.

setAuth(\cAuth $auth) : void

Parameters

$auth

\cAuth

auth object

Sets the client ID to store it locally in the class.

setClientId(int $clientId) : void

Parameters

$clientId

int

client ID

Sets the language ID to store it locally in the class.

setLanguageId(int $languageId) : void

Parameters

$languageId

int

language ID

Constructor of the class.

__construct() : void

 Properties

 

$_auth : \cAuth
 

$_clientId : int
 

$_feGroups : array
   

$_languageId : int
 

$_levelCache : array
 

$_instance : \cCategoryHelper