Class CMS_moduleCategories_catalog

Description

Class CMS_moduleCategories_catalog

Factory and any useful methods to manage CMS_moduleCategory instances

Located in /automne/classes/modules/modulecategoriescatalog.php (line 29)

CMS_grandFather
   |
   --CMS_moduleCategories_catalog
Method Summary
 static boolean attachCategory ( &$category,  &$parentCategory, CMS_moduleCategory $category, CMS_moduleCategory $parentCategory)
 static mixed categoryExists (string $module, string $uuid)
 static boolean compactSiblingsOrder ( $category, [ $codename = false], integer $category_id,)
 static boolean detachCategory ( &$category, CMS_moduleCategory $category)
 static boolean fromArray (array $data, array $params, CMS_language $cms_language,  &$idsRelation,  &$infos, array $idsRelation, string $infos)
 static array(CMS_moduleCategory) getAll ( $attrs, array $attrs,)
 static array(string) getAllCategoriesAsArray ( &$cms_user,  $cms_module,  $cms_language, [ $level = 0], [ $root = -1], [mixed $clearanceLevel = false], [boolean $strict = false], [ $crossLanguage = false], CMS_profile $cms_user,, string $cms_module,, CMS_language $cms_language,, integer $level,, integer $root,)
 static CMS_moduleCategory getByID (integer $id, [CMS_language $language = false])
 static integer getCategoryIdFromLineage ( $lineage, [ $level = 0], strign $lineage,, integer $level,)
 static array(CMS_moduleCategory) getDeletedCategories ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
 static integer getLastSiblingOrder ([ $parentCategoryID = 0], integer $parentCategoryID,)
 static array(integer) getLineageOfCategory ( $categoryID, [ $reset = false], integer $categoryID,)
 static string getLineageOfCategoryAsString ( $category_id, [ $separator = ";"], integer $category_id,, string $separator,)
 static string, getListBox ( $args, mixed array())
 static string, getListBoxes ( $args, mixed array())
 static false getParentIdOf ( $categoryID, [ $reset = false], integer $categoryID,, boolean $reset,)
 static array(string) getSiblingCategoriesAsArray ( &$category,  $count,  &$cms_user,  $cms_module,  $cms_language, [mixed $clearanceLevel = false], [boolean $strict = false], CMS_profile $cms_user,, string $cms_module,, CMS_language $cms_language,)
 static array(catID getViewvableCategoriesForProfile ( &$cms_user, [string $module = false], [boolean $returnLineageArray = false], [mixed $clearanceLevel = false], [boolean $strict = false], CMS_profile $cms_user,)
 static boolean moveCategory ( &$category,  &$newParentCategory, [integer $index = false], CMS_moduleCategory $category, CMS_moduleCategory $parentCategory)
 static boolean moveCategoryIndex (CMS_moduleCategory $category, integer $index)
 static boolean moveCategoryOrder ( &$siblingCategory, integer $moveOffset, CMS_moduleCategory $siblingCategory)
 static boolean uuidExists (string $uuid)
Methods
static attachCategory (line 119)

Attach a category to parent given

  • return: true on success, false on failure
  • access: public
static boolean attachCategory ( &$category,  &$parentCategory, CMS_moduleCategory $category, CMS_moduleCategory $parentCategory)
static categoryExists (line 1062)

Does a category exists with given parameters this method is use by fromArray import method to know if an imported category already exist or not

  • return: : integer id if exists, false otherwise
  • access: public
static mixed categoryExists (string $module, string $uuid)
  • string $module: The module codename to check
  • string $uuid: The category uuid to check
static compactSiblingsOrder (line 244)

Check and/or repair positions in siblings of a given category if ever needed

  • access: public
static boolean compactSiblingsOrder ( $category, [ $codename = false], integer $category_id,)
  • integer $category_id,: category ID to compact
  • $category
  • $codename
static detachCategory (line 151)

Detach a category from its parent and destroys category

  • return: true on success, false on failure
  • access: public
static boolean detachCategory ( &$category, CMS_moduleCategory $category)
static fromArray (line 987)

Import module from given array datas

  • return: : true on success, false on failure
  • access: public
static boolean fromArray (array $data, array $params, CMS_language $cms_language,  &$idsRelation,  &$infos, array $idsRelation, string $infos)
  • array $data: The module datas to import
  • array $params: The import parameters. array( module => false|true : the module to create categories (required) create => false|true : create missing objects (default : true) update => false|true : update existing objects (default : true) files => false|true : use files from PATH_TMP_FS (default : true) )
  • CMS_language $cms_language: The CMS_langage to use
  • array $idsRelation: : Reference : The relations between import datas ids and real imported ids
  • string $infos: : Reference : The import infos returned
  • &$idsRelation
  • &$infos
static getAll (line 633)

Return categories founded in given module in current language

  • access: public
static array(CMS_moduleCategory) getAll ( $attrs, array $attrs,)
  • array $attrs,: search criteria Array ( "module" => string "language" => CMS_language "level" => integer (Default -1) "root" => integer (Default -1) "cms_user" => CMS_profile "clearanceLevel" => mixed (default : false)
    • false : CLEARANCE_MODULE_VIEW
    • true : CLEARANCE_MODULE_EDIT
    • constant value : clearanceLevel value
    "strict" => boolean (default : false) )
  • $attrs
static getAllCategoriesAsArray (line 805)

Returns each category ID and label in a module given user can see (from : none, to : view)

  • return: the statements or false if profile hasn't any access to any categories
  • access: public
static array(string) getAllCategoriesAsArray ( &$cms_user,  $cms_module,  $cms_language, [ $level = 0], [ $root = -1], [mixed $clearanceLevel = false], [boolean $strict = false], [ $crossLanguage = false], CMS_profile $cms_user,, string $cms_module,, CMS_language $cms_language,, integer $level,, integer $root,)
  • CMS_profile $cms_user,: the profile concerned by these restrictions
  • string $cms_module,: the module codename
  • CMS_language $cms_language,: the language of the labels
  • integer $level,: the level category if any
  • integer $root,: the root category if any
  • mixed $clearanceLevel: - false : CLEARANCE_MODULE_VIEW
    • true : CLEARANCE_MODULE_EDIT
    • constant value : clearanceLevel value
  • boolean $strict: return only categories from this clearance (default : false, else, return complete categories tree until given clearance)
  • &$cms_user
  • $cms_module
  • $cms_language
  • $level
  • $root
  • $crossLanguage
static getByID (line 37)
  • access: public
static CMS_moduleCategory getByID (integer $id, [CMS_language $language = false])
static getCategoryIdFromLineage (line 604)

Parses a lineage and returns a category ID in given level By default returns root category ID in lineage

  • return: the category ID
  • access: public
static integer getCategoryIdFromLineage ( $lineage, [ $level = 0], strign $lineage,, integer $level,)
  • strign $lineage,: string with integers separated with ;
  • integer $level,: which level to get from lineage (default is rott, so 0)
  • $lineage
  • $level
static getDeletedCategories (line 56)

Return categories marked as deleted

  • access: public
static array(CMS_moduleCategory) getDeletedCategories ([ $module = false], [ $return_objects = false], string $module,, boolean $return_objects,)
  • string $module,: the module codename who want's deleted cats
  • boolean $return_objects,: does the function return array of objects or array of objects ID
  • $module
  • $return_objects
static getLastSiblingOrder (line 96)

Get the last position used in siblings list

  • access: public
static integer getLastSiblingOrder ([ $parentCategoryID = 0], integer $parentCategoryID,)
  • integer $parentCategoryID,: ID of parent category to count order of
  • $parentCategoryID
static getLineageOfCategory (line 530)

Gives an array containing the lineage of a category ID was given From oldest ancestor to itself

  • access: public
static array(integer) getLineageOfCategory ( $categoryID, [ $reset = false], integer $categoryID,)
  • integer $categoryID,: the category ID
  • $categoryID
  • $reset
static getLineageOfCategoryAsString (line 577)

Gives a string representing the lineage of a category whose ID was given From oldest ancestor to itself, imploded with ; (semicolon) by Default

  • access: public
static string getLineageOfCategoryAsString ( $category_id, [ $separator = ";"], integer $category_id,, string $separator,)
  • integer $category_id,: the category ID
  • string $separator,: the separator we want to use instead of semicolon (;)
  • $category_id
  • $separator
static getListBox (line 956)

Create a select box XHTML containing all categories user has access to

View CMS_dialog_listboxes::getListBox for detail

  • return: XHTML formated
static string, getListBox ( $args, mixed array())
  • mixed array(): $args, This array contains all parameters.
  • $args
static getListBoxes (line 966)

Create 2 listboxes XHTML exchanging their values through javascript

View CMS_dialog_listboxes::getListBoxes for detail

  • return: XHTML formated
static string, getListBoxes ( $args, mixed array())
  • mixed array(): $args, This array contains all parameters.
  • $args
static getParentIdOf (line 482)

Get the ID of the category parent to another This method must be as fast as possible

  • return: if nothing founded, or integer parentID
  • access: public
static false getParentIdOf ( $categoryID, [ $reset = false], integer $categoryID,, boolean $reset,)
  • integer $categoryID,: the category ID to get parent of
  • boolean $reset,: force cache reloading : default false (used by writeToPersistence in CMS_moduleCategory)
  • $categoryID
  • $reset
static getSiblingCategoriesAsArray (line 919)

Returns each category ID and label in a module given user can see

  • return: the statements or false if profile hasn't any access to any categories
  • access: public
static array(string) getSiblingCategoriesAsArray ( &$category,  $count,  &$cms_user,  $cms_module,  $cms_language, [mixed $clearanceLevel = false], [boolean $strict = false], CMS_profile $cms_user,, string $cms_module,, CMS_language $cms_language,)
  • CMS_profile $cms_user,: the profile concerned by these restrictions
  • string $cms_module,: the module codename
  • CMS_language $cms_language,: the language of the labels
  • mixed $clearanceLevel: - false : CLEARANCE_MODULE_VIEW
    • true : CLEARANCE_MODULE_EDIT
    • constant value : clearanceLevel value
  • boolean $strict: return only categories from this clearance (default : false, else, return complete categories tree until given clearance)
  • &$category
  • $count
  • &$cms_user
  • $cms_module
  • $cms_language
static getViewvableCategoriesForProfile (line 727)

Returns a multidimentionnal array of categories viewvable If access control is active, we need to limit serch to user's permissions on categories

  • return: => array(catID => array(...)))
  • access: public
static array(catID getViewvableCategoriesForProfile ( &$cms_user, [string $module = false], [boolean $returnLineageArray = false], [mixed $clearanceLevel = false], [boolean $strict = false], CMS_profile $cms_user,)
  • CMS_profile $cms_user,: the profile concerned by these restrictions
  • string $module: the module codename we want
  • boolean $returnLineageArray: return array like array(catID => catLineage) instead
  • mixed $clearanceLevel: - false : CLEARANCE_MODULE_VIEW
    • true : CLEARANCE_MODULE_EDIT
    • constant value : clearanceLevel value
  • boolean $strict: return only categories from this clearance (default : false, else, return complete categories tree until given clearance)
  • &$cms_user
static moveCategory (line 198)

Moves a cateogry from its parent to another

  • return: true on success, false on failure
  • access: public
static boolean moveCategory ( &$category,  &$newParentCategory, [integer $index = false], CMS_moduleCategory $category, CMS_moduleCategory $parentCategory)
  • CMS_moduleCategory $category
  • CMS_moduleCategory $parentCategory
  • integer $index: : the new index for the new parent (if false, put the category at last position)
  • &$category
  • &$newParentCategory
static moveCategoryIndex (line 323)

Moves position of a category in list at given index

  • return: true on succes, false on failure
  • access: public
static boolean moveCategoryIndex (CMS_moduleCategory $category, integer $index)
static moveCategoryOrder (line 401)

Moves position of a category in list, with given offset

  • return: true on succes, false on failure
  • access: public
static boolean moveCategoryOrder ( &$siblingCategory, integer $moveOffset, CMS_moduleCategory $siblingCategory)
  • CMS_moduleCategory $siblingCategory
  • integer $moveOffset: values 1 or -1 expected
  • &$siblingCategory
static uuidExists (line 1093)

Does given uuid already exists for categories

  • access: public
static boolean uuidExists (string $uuid)
  • string $uuid: The category uuid to check

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants

Documentation generated on Wed, 15 Feb 2012 15:32:19 +0100 by phpDocumentor 1.4.3