Properties

$id

$id : 

Type

$id_cms_category

$id_cms_category : integer

Type

integer — CMSCategory ID

$name

$name : string

Type

string — Name

$active

$active : boolean

Type

boolean — Status for display

$description

$description : string

Type

string — Description

$id_parent

$id_parent : integer

Type

integer — Parent CMSCategory ID

$position

$position : integer

Type

integer — category position

$level_depth

$level_depth : integer

Type

integer — Parents number

$link_rewrite

$link_rewrite : string

Type

string — string used in rewrited URL

$meta_title

$meta_title : string

Type

string — Meta title

$meta_keywords

$meta_keywords : string

Type

string — Meta keywords

$meta_description

$meta_description : string

Type

string — Meta description

$date_add

$date_add : string

Type

string — Object creation date

$date_upd

$date_upd : string

Type

string — Object last modification date

$definition

$definition : 

Type

$_links

$_links : 

Type

Methods

add()

add(  $autodate = true,   $null_values = false) 

Parameters

$autodate
$null_values

update()

update(  $null_values = false) 

Parameters

$null_values

recurseLiteCategTree()

recurseLiteCategTree(integer  $max_depth = 3, integer  $currentDepth,   $id_lang = null, array  $excluded_ids_array = null, \Link  $link = null) : array

Recursive scan of subcategories

Parameters

integer $max_depth

Maximum depth of the tree (i.e. 2 => 3 levels depth)

integer $currentDepth

specify the current depth in the tree (don't use it, only for rucursivity!)

$id_lang
array $excluded_ids_array

specify a list of ids to exclude of results

\Link $link

Returns

array —

Subcategories lite tree

getRecurseCategory()

getRecurseCategory(  $id_lang = null,   $current = 1,   $active = 1,   $links, \Link  $link = null) 

Parameters

$id_lang
$current
$active
$links
\Link $link

recurseCMSCategory()

recurseCMSCategory(  $categories,   $current,   $id_cms_category = 1,   $id_selected = 1,   $is_html) 

Parameters

$categories
$current
$id_cms_category
$id_selected
$is_html

delete()

delete() 

deleteSelection()

deleteSelection(  $categories) 

Delete several categories from database

return boolean Deletion result

Parameters

$categories

calcLevelDepth()

calcLevelDepth() : integer

Get the number of parent categories

Returns

integer —

Level depth

getCategories()

getCategories(integer  $id_lang, boolean  $active = true,   $order = true) : array

Return available categories

Parameters

integer $id_lang

Language ID

boolean $active

return only active categories

$order

Returns

array —

Categories

getSimpleCategories()

getSimpleCategories(  $id_lang) 

Parameters

$id_lang

getSubCategories()

getSubCategories(integer  $id_lang, boolean  $active = true) : array

Return current CMSCategory childs

Parameters

integer $id_lang

Language ID

boolean $active

return only active categories

Returns

array —

Categories

hideCMSCategoryPosition()

hideCMSCategoryPosition(string  $name) : string

Hide CMSCategory prefix used for position

Parameters

string $name

CMSCategory name

Returns

string —

Name without position

getHomeCategories()

getHomeCategories(integer  $id_lang, boolean  $active = true) : array

Return main categories

Parameters

integer $id_lang

Language ID

boolean $active

return only active categories

Returns

array —

categories

getChildren()

getChildren(  $id_parent,   $id_lang,   $active = true) 

Parameters

$id_parent
$id_lang
$active

checkBeforeMove()

checkBeforeMove(  $id_cms_category, integer  $id_parent) : boolean

Check if CMSCategory can be moved in another one

Parameters

$id_cms_category
integer $id_parent

Parent candidate

Returns

boolean —

Parent validity

getLinkRewrite()

getLinkRewrite(  $id_cms_category,   $id_lang) 

Parameters

$id_cms_category
$id_lang

getLink()

getLink(\Link  $link = null) 

Parameters

\Link $link

getName()

getName(  $id_lang = null) 

Parameters

$id_lang

searchByName()

searchByName(integer  $id_lang, string  $query, boolean  $unrestricted = false) : array

Light back office search for categories

Parameters

integer $id_lang

Language ID

string $query

Searched string

boolean $unrestricted

allows search without lang and includes first CMSCategory and exact match

Returns

array —

Corresponding categories

searchByNameAndParentCMSCategoryId()

searchByNameAndParentCMSCategoryId(integer  $id_lang, string  $CMSCategory_name, integer  $id_parent_CMSCategory) : array

Retrieve CMSCategory by name and parent CMSCategory id

Parameters

integer $id_lang

Language ID

string $CMSCategory_name

Searched CMSCategory name

integer $id_parent_CMSCategory

parent CMSCategory ID

Returns

array —

Corresponding CMSCategory

getParentsCategories()

getParentsCategories(integer  $id_lang = null) : array

Get Each parent CMSCategory of this CMSCategory until the root CMSCategory

Parameters

integer $id_lang

Language ID

Returns

array —

Corresponding categories

updatePosition()

updatePosition(  $way,   $position) 

Parameters

$way
$position

cleanPositions()

cleanPositions(  $id_category_parent) 

Parameters

$id_category_parent

getLastPosition()

getLastPosition(  $id_category_parent) 

Parameters

$id_category_parent

getUrlRewriteInformations()

getUrlRewriteInformations(  $id_category) 

Parameters

$id_category

recursiveDelete()

recursiveDelete(  $to_delete, array|integer  $id_cms_category) 

Recursively add specified CMSCategory childs to $toDelete array

Parameters

$to_delete
array|integer $id_cms_category

Parent CMSCategory ID