- Class name: CMSCategoryCore
- Parent class: ObjectModel
- Source: classes/CMSCategory.php line 27
- $_links
- $active
- $date_add
- $date_upd
- $definition
- $description
- $id
- $id_cms_category
- $id_parent
- $level_depth
- $link_rewrite
- $meta_description
- $meta_keywords
- $meta_title
- $name
- $position
- $db
- $def
- $fieldsRequired
- $fieldsRequiredDatabase
- $fieldsRequiredLang
- $fieldsSize
- $fieldsSizeLang
- $fieldsValidate
- $fieldsValidateLang
- $get_shop_from_context
- $id_lang
- $id_shop
- $id_shop_list
- $identifier
- $image_dir
- $image_format
- $table
- $tables
- $update_fields
- $webserviceParameters
- __construct
- add
- addFieldsRequiredDatabase
- associateTo
- cacheFieldsRequiredDatabase
- calcLevelDepth
- checkBeforeMove
- cleanPositions
- clearCache
- delete
- deleteImage
- deleteSelection
- displayFieldName
- duplicateObject
- duplicateShops
- existsInDatabase
- formatFields
- formatValue
- getAssociatedShops
- getCategories
- getChildren
- getDefinition
- getFieldByLang
- getFields
- getFieldsLang
- getFieldsRequiredDatabase
- getFieldsShop
- getHomeCategories
- getLastPosition
- getLink
- getLinkRewrite
- getName
- getParentsCategories
- getRecurseCategory
- getSimpleCategories
- getSubCategories
- getTranslationsFields
- getUrlRewriteInformations
- getValidationRules
- getWebserviceObjectList
- getWebserviceParameters
- hasMultishopEntries
- hideCMSCategoryPosition
- hydrate
- hydrateCollection
- isAssociatedToShop
- isCurrentlyUsed
- isLangMultishop
- isMultiShopField
- isMultishop
- makeTranslationFields
- recurseCMSCategory
- recurseLiteCategTree
- recursiveDelete
- save
- searchByName
- searchByNameAndParentCMSCategoryId
- setDefinitionRetrocompatibility
- setFieldsToUpdate
- toggleStatus
- update
- updateMultishopTable
- updatePosition
- validateControler
- validateController
- validateField
- validateFields
- validateFieldsLang
- validateFieldsRequiredDatabase
protected mixed $_links = array()
- Visibility: protected
- This property is static.
- Source: classes/CMSCategory.php line 70.
public boolean $active = 1
- Visibility: public
- Source: classes/CMSCategory.php line 38.
public string $date_add
- Visibility: public
- Source: classes/CMSCategory.php line 65.
public string $date_upd
- Visibility: public
- Source: classes/CMSCategory.php line 68.
public mixed $definition = array('table' => 'cms_category', 'primary' => 'id_cms_category', 'multilang' => true, 'fields' => array('active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), 'id_parent' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), 'position' => array('type' => self::TYPE_INT), 'level_depth' => array('type' => self::TYPE_INT), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 64), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 64), 'description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCleanHtml'), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128), 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255)))
- Visibility: public
- This property is static.
- Source: classes/CMSCategory.php line 75.
public string $description
- Visibility: public
- Source: classes/CMSCategory.php line 41.
public mixed $id
- Visibility: public
- Source: classes/CMSCategory.php line 29.
public integer $id_cms_category
- Visibility: public
- Source: classes/CMSCategory.php line 32.
public integer $id_parent
- Visibility: public
- Source: classes/CMSCategory.php line 44.
public integer $level_depth
- Visibility: public
- Source: classes/CMSCategory.php line 50.
public string $link_rewrite
- Visibility: public
- Source: classes/CMSCategory.php line 53.
public string $meta_description
- Visibility: public
- Source: classes/CMSCategory.php line 62.
public string $meta_keywords
- Visibility: public
- Source: classes/CMSCategory.php line 59.
public string $meta_title
- Visibility: public
- Source: classes/CMSCategory.php line 56.
public string $name
- Visibility: public
- Source: classes/CMSCategory.php line 35.
public integer $position
- Visibility: public
- Source: classes/CMSCategory.php line 47.
protected \Db $db = false
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 140.
protected array $def
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 130.
protected mixed $fieldsRequired = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 80.
protected mixed $fieldsRequiredDatabase = null
- Visibility: protected
- This property is static.
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 65.
protected mixed $fieldsRequiredLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 95.
protected mixed $fieldsSize = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 85.
protected mixed $fieldsSizeLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 100.
protected mixed $fieldsValidate = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 90.
protected mixed $fieldsValidateLang = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 105.
protected mixed $get_shop_from_context = true
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 63.
protected integer $id_lang = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 57.
protected mixed $id_shop = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 59.
public mixed $id_shop_list = null
- Visibility: public
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 61.
protected mixed $identifier
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 75.
protected string $image_dir = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 116.
protected string $image_format = 'jpg'
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 119.
protected mixed $table
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 70.
protected mixed $tables = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 110.
protected array $update_fields = null
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 135.
protected array $webserviceParameters = array()
- Visibility: protected
- This property is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 113.
mixed ObjectModelCore::__construct(integer $id, integer $id_lang, integer $id_shop)
Build object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 168
- $id integer - Existing object id in order to load object (optional)
- $id_lang integer - Required if object is multilingual (optional)
- $id_shop integer - ID shop for objects with multishop on langs
mixed CMSCategoryCore::add($autodate, $null_values)
- Visibility: public
- Source: classes/CMSCategory.php line 97
- $autodate mixed
- $null_values mixed
mixed ObjectModelCore::addFieldsRequiredDatabase($fields)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1212
- $fields mixed
boolean ObjectModelCore::associateTo(integer|array $id_shops)
This function associate an item to its context
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1264
- $id_shops integer|array
mixed ObjectModelCore::cacheFieldsRequiredDatabase()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1199
integer CMSCategoryCore::calcLevelDepth()
Get the number of parent categories
- Visibility: public
- Source: classes/CMSCategory.php line 289
boolean CMSCategoryCore::checkBeforeMove($id_cms_category, integer $id_parent)
Check if CMSCategory can be moved in another one
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 416
- $id_cms_category mixed
- $id_parent integer - Parent candidate
mixed CMSCategoryCore::cleanPositions($id_category_parent)
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 577
- $id_category_parent mixed
mixed ObjectModelCore::clearCache($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1226
- $all mixed
mixed CMSCategoryCore::delete()
- Visibility: public
- Source: classes/CMSCategory.php line 236
boolean ObjectModelCore::deleteImage($force_delete)
Delete images associated with the object
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1395
- $force_delete mixed
mixed CMSCategoryCore::deleteSelection($categories)
Delete several categories from database
return boolean Deletion result
- Visibility: public
- Source: classes/CMSCategory.php line 273
- $categories mixed
mixed ObjectModelCore::displayFieldName($field, $class, $htmlentities, \Context $context)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 982
- $field mixed
- $class mixed
- $htmlentities mixed
- $context Context
\new ObjectModelCore::duplicateObject()
Duplicate current object to database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 521
mixed ObjectModelCore::duplicateShops($id)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1308
- $id mixed
boolean ObjectModelCore::existsInDatabase(integer $id_entity, string $table)
Specify if an ObjectModel is already in database
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1432
- $id_entity integer
- $table string
array ObjectModelCore::formatFields(integer $type, integer $id_lang)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 325
- $type integer - FORMAT_COMMON or FORMAT_LANG or FORMAT_SHOP
- $id_lang integer - If this parameter is given, only take lang fields
mixed ObjectModelCore::formatValue(mixed $value, integer $type, $with_quotes, $purify)
Format a data
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 372
- $value mixed
- $type integer
- $with_quotes mixed
- $purify mixed
array ObjectModelCore::getAssociatedShops()
Get the list of associated id_shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1293
array CMSCategoryCore::getCategories(integer $id_lang, boolean $active, $order)
Return available categories
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 304
- $id_lang integer - Language ID
- $active boolean - return only active categories
- $order mixed
mixed CMSCategoryCore::getChildren($id_parent, $id_lang, $active)
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 386
- $id_parent mixed
- $id_lang mixed
- $active mixed
array ObjectModelCore::getDefinition(string $class, string $field)
Get object definition
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1538
- $class string - Name of object
- $field string - Name of field if we want the definition of one field only
mixed ObjectModelCore::getFieldByLang($field_name, null $id_lang)
Return the field value for the specified language if the field is multilang, else the field value.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1645
- $field_name mixed
- $id_lang null
array ObjectModelCore::getFields()
Prepare fields for ObjectModel class (add, update) All fields are verified (pSQL, intval.
..)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 253
array ObjectModelCore::getFieldsLang()
Prepare multilang fields
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 290
mixed ObjectModelCore::getFieldsRequiredDatabase($all)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1191
- $all mixed
array ObjectModelCore::getFieldsShop()
Prepare fields for multishop Fields are not validated here, we considere they are already validated in getFields() method, this not the best solution but this is the only one possible for retro compatibility.
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 276
array CMSCategoryCore::getHomeCategories(integer $id_lang, boolean $active)
Return main categories
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 381
- $id_lang integer - Language ID
- $active boolean - return only active categories
mixed CMSCategoryCore::getLastPosition($id_category_parent)
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 597
- $id_category_parent mixed
mixed CMSCategoryCore::getLink(\Link $link)
- Visibility: public
- Source: classes/CMSCategory.php line 450
- $link Link
mixed CMSCategoryCore::getLinkRewrite($id_cms_category, $id_lang)
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 432
- $id_cms_category mixed
- $id_lang mixed
mixed CMSCategoryCore::getName($id_lang)
- Visibility: public
- Source: classes/CMSCategory.php line 457
- $id_lang mixed
array CMSCategoryCore::getParentsCategories(integer $id_lang)
Get Each parent CMSCategory of this CMSCategory until the root CMSCategory
- Visibility: public
- Source: classes/CMSCategory.php line 521
- $id_lang integer - Language ID
mixed CMSCategoryCore::getRecurseCategory($id_lang, $current, $active, $links, \Link $link)
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 161
- $id_lang mixed
- $current mixed
- $active mixed
- $links mixed
- $link Link
mixed CMSCategoryCore::getSimpleCategories($id_lang)
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 326
- $id_lang mixed
array CMSCategoryCore::getSubCategories(integer $id_lang, boolean $active)
Return current CMSCategory childs
- Visibility: public
- Source: classes/CMSCategory.php line 343
- $id_lang integer - Language ID
- $active boolean - return only active categories
mixed ObjectModelCore::getTranslationsFields($fields_array)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 772
- $fields_array mixed
mixed CMSCategoryCore::getUrlRewriteInformations($id_category)
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 602
- $id_category mixed
array ObjectModelCore::getValidationRules(string $class)
Returns object validation rules (fields validity)
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 148
- $class string - Child class name for static use (optional)
mixed ObjectModelCore::getWebserviceObjectList($sql_join, $sql_filter, $sql_sort, $sql_limit)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1132
- $sql_join mixed
- $sql_filter mixed
- $sql_sort mixed
- $sql_limit mixed
mixed ObjectModelCore::getWebserviceParameters($ws_params_attribute_name)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1054
- $ws_params_attribute_name mixed
boolean ObjectModelCore::hasMultishopEntries()
Check if there is more than one entries in associated shop table for current entity
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1333
string CMSCategoryCore::hideCMSCategoryPosition(string $name)
Hide CMSCategory prefix used for position
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 369
- $name string - CMSCategory name
mixed ObjectModelCore::hydrate(array $data, integer $id_lang)
Fill an object with given data. Data must be an array with this syntax: array(objProperty => value, objProperty2 => value, etc.)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1470
- $data array
- $id_lang integer
array ObjectModelCore::hydrateCollection(string $class, array $datas, integer $id_lang)
Fill (hydrate) a list of objects in order to get a collection of these objects
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1489
- $class string - Class of objects to hydrate
- $datas array - List of data (multi-dimensional array)
- $id_lang integer
boolean ObjectModelCore::isAssociatedToShop(integer $id_shop)
Check if current object is associated to a shop
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1241
- $id_shop integer
boolean ObjectModelCore::isCurrentlyUsed(string $table, boolean $has_active_column)
This method is allow to know if a entity is currently used
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1450
- $table string - name of table linked to entity
- $has_active_column boolean - true if the table has an active column
mixed ObjectModelCore::isLangMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1350
mixed ObjectModelCore::isMultiShopField($field)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1345
- $field mixed
mixed ObjectModelCore::isMultishop()
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1340
mixed ObjectModelCore::makeTranslationFields($fields, $fields_array, $id_language)
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 788
- $fields mixed
- $fields_array mixed
- $id_language mixed
mixed CMSCategoryCore::recurseCMSCategory($categories, $current, $id_cms_category, $id_selected, $is_html)
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 201
- $categories mixed
- $current mixed
- $id_cms_category mixed
- $id_selected mixed
- $is_html mixed
array CMSCategoryCore::recurseLiteCategTree(integer $max_depth, integer $currentDepth, $id_lang, array $excluded_ids_array, \Link $link)
Recursive scan of subcategories
- Visibility: public
- Source: classes/CMSCategory.php line 128
- $max_depth integer - Maximum depth of the tree (i.e. 2 => 3 levels depth)
- $currentDepth integer - specify the current depth in the tree (don't use it, only for rucursivity!)
- $id_lang mixed
- $excluded_ids_array array - specify a list of ids to exclude of results
- $link Link
mixed CMSCategoryCore::recursiveDelete($to_delete, array|integer $id_cms_category)
Recursively add specified CMSCategory childs to $toDelete array
- Visibility: protected
- Source: classes/CMSCategory.php line 220
- $to_delete mixed
- $id_cms_category array|integer - Parent CMSCategory ID
boolean ObjectModelCore::save(boolean $null_values, boolean $autodate)
Save current object to database (add or update)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 418
- $null_values boolean
- $autodate boolean
array CMSCategoryCore::searchByName(integer $id_lang, string $query, boolean $unrestricted)
Light back office search for categories
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 478
- $id_lang integer - Language ID
- $query string - Searched string
- $unrestricted boolean - allows search without lang and includes first CMSCategory and exact match
array CMSCategoryCore::searchByNameAndParentCMSCategoryId(integer $id_lang, string $CMSCategory_name, integer $id_parent_CMSCategory)
Retrieve CMSCategory by name and parent CMSCategory id
- Visibility: public
- This method is static.
- Source: classes/CMSCategory.php line 503
- $id_lang integer - Language ID
- $CMSCategory_name string - Searched CMSCategory name
- $id_parent_CMSCategory integer - parent CMSCategory ID
mixed ObjectModelCore::setDefinitionRetrocompatibility()
Retrocompatibility for classes without $definition static Remove this in 1.6 !
- Visibility: protected
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1576
mixed ObjectModelCore::setFieldsToUpdate(array $fields)
Set a list of specific fields to update array(field1 => true, field2 => false, langfield1 => array(1 => true, 2 => false))
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1671
- $fields array
boolean ObjectModelCore::toggleStatus()
Toggle object status in database
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 753
mixed CMSCategoryCore::update($null_values)
- Visibility: public
- Source: classes/CMSCategory.php line 109
- $null_values mixed
boolean ObjectModelCore::updateMultishopTable(string $classname, array $data, string $where, string $specific_where)
Update a table and splits the common datas and the shop datas
- Visibility: public
- This method is static.
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1365
- $classname string
- $data array
- $where string
- $specific_where string - Only executed for common table
mixed CMSCategoryCore::updatePosition($way, $position)
- Visibility: public
- Source: classes/CMSCategory.php line 545
- $way mixed
- $position mixed
mixed ObjectModelCore::validateControler($htmlentities)
TODO: refactor rename all calls to this to validateController
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1000
- $htmlentities mixed
mixed ObjectModelCore::validateController($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1006
- $htmlentities mixed
boolean|string ObjectModelCore::validateField(string $field, mixed $value, integer $id_lang, $skip, $human_errors)
Validate a single field
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 899
- $field string - Field name
- $value mixed - Field value
- $id_lang integer
- $skip mixed
- $human_errors mixed
boolean|string ObjectModelCore::validateFields(boolean $die, boolean $error_return)
Check for fields validity before database interaction
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 826
- $die boolean
- $error_return boolean
boolean|string ObjectModelCore::validateFieldsLang(boolean $die, boolean $error_return)
Check for multilingual fields validity before database interaction
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 855
- $die boolean
- $error_return boolean
mixed ObjectModelCore::validateFieldsRequiredDatabase($htmlentities)
- Visibility: public
- This method is defined by ObjectModelCore.
- Source: classes/ObjectModel.php line 1168
- $htmlentities mixed