Public Member Functions | Protected Member Functions | Protected Attributes

oxCategoryList Class Reference

Inheritance diagram for oxCategoryList:
Collaboration diagram for oxCategoryList:

List of all members.

Public Member Functions

 __construct ($sObjectsInListName= 'oxcategory')
 load ()
 buildTree ($sActCat)
 buildList ($blLoad)
 setShopID ($sShopID)
 getPath ()
 getClickCat ()
 getClickRoot ()
 updateCategoryTree ($blVerbose=true, $sShopID=null)
 getUpdateInfo ()
 __get ($sName)

Protected Member Functions

 _getSqlSelectFieldsForTree ($sTable, $aColumns=null)
 _getSelectString ($blReverse=false, $aColumns=null, $sOrder=null)
 _getDepthSqlSnippet ($oCat)
 _getDepthSqlUnion ($oCat, $aColumns=null)
 _loadFromDb ()
 _ppLoadFullCategory ($sId)
 _ppRemoveInactiveCategories ()
 _ppAddPathInfo ()
 _ppAddContentCategories ()
 _ppBuildTree ()
 _ppAddDepthInformation ()
 _addDepthInfo ($aTree, $oCat, $sDepth="")
 _updateNodes ($oxRootId, $isroot, $thisRoot)

Protected Attributes

 $_sObjectsInListName = 'oxcategory'
 $_blHideEmpty = false
 $_blForceFull = false
 $_sActCat = null
 $_aPath = array()
 $_aUpdateInfo = array()

Detailed Description

Category list manager. Collects available categories, performs some SQL queries to create category list structure.

Definition at line 10 of file oxcategorylist.php.


Constructor & Destructor Documentation

oxCategoryList.__construct ( sObjectsInListName = 'oxcategory'  ) 

Class constructor, initiates parent constructor (parent.oxList()).

Parameters:
string $sObjectsInListName optional parameter, the objects contained in the list, always oxcategory
Returns:
null

Reimplemented from oxList.

Definition at line 61 of file oxcategorylist.php.


Member Function Documentation

oxCategoryList.__get ( sName  ) 

Extra getter to guarantee compatibility with templates

Parameters:
string $sName variable name
Returns:
string

Reimplemented from oxList.

Definition at line 595 of file oxcategorylist.php.

oxCategoryList._addDepthInfo ( aTree,
oCat,
sDepth = "" 
) [protected]

Recursive function to add depth information

Parameters:
array $aTree new category tree
object $oCat category object
string $sDepth string to show category depth
Returns:
array $aTree

Definition at line 488 of file oxcategorylist.php.

oxCategoryList._getDepthSqlSnippet ( oCat  )  [protected]

constructs the sql snippet responsible for depth optimizations, loads only selected category's siblings

Parameters:
oxCategory $oCat selected category
Returns:
string

Definition at line 144 of file oxcategorylist.php.

oxCategoryList._getDepthSqlUnion ( oCat,
aColumns = null 
) [protected]

returns sql snippet for union of select category's and its upper level siblings of the same root (siblings of the categotry, and parents and grandparents etc)

Parameters:
oxCategory $oCat current category object
array $aColumns required column names (optional)
Returns:
string

Definition at line 171 of file oxcategorylist.php.

oxCategoryList._getSelectString ( blReverse = false,
aColumns = null,
sOrder = null 
) [protected]

constructs the sql string to get the category list

Parameters:
bool $blReverse list loading order, true for tree, false for simple list (optional, default false)
array $aColumns required column names (optional)
string $sOrder order by string (optional)
Returns:
string

Definition at line 108 of file oxcategorylist.php.

oxCategoryList._getSqlSelectFieldsForTree ( sTable,
aColumns = null 
) [protected]

return fields to select while loading category tree

Parameters:
string $sTable table name
array $aColumns required column names (optional)
Returns:
string return

Definition at line 75 of file oxcategorylist.php.

oxCategoryList._loadFromDb (  )  [protected]

Get data from db

Returns:
array

Definition at line 194 of file oxcategorylist.php.

oxCategoryList._ppAddContentCategories (  )  [protected]

Category list postprocessing routine, responsible adding of content categories

Returns:
null

Definition at line 417 of file oxcategorylist.php.

oxCategoryList._ppAddDepthInformation (  )  [protected]

Category list postprocessing routine, responsible for making flat category tree and adding depth information. Requires reversed category list!

Returns:
null

Definition at line 459 of file oxcategorylist.php.

oxCategoryList._ppAddPathInfo (  )  [protected]

Category list postprocessing routine, responsible for generation of active category path

Returns:
null

Definition at line 393 of file oxcategorylist.php.

oxCategoryList._ppBuildTree (  )  [protected]

Category list postprocessing routine, responsible building an sorting of hierarchical category tree

Returns:
null

Definition at line 436 of file oxcategorylist.php.

oxCategoryList._ppLoadFullCategory ( sId  )  [protected]

set full category object in tree

Parameters:
string $sId category id
Returns:
null

Definition at line 262 of file oxcategorylist.php.

oxCategoryList._ppRemoveInactiveCategories (  )  [protected]

Category list postprocessing routine, responsible for removal of inactive of forbidden categories, and subcategories.

Returns:
null

Definition at line 354 of file oxcategorylist.php.

oxCategoryList._updateNodes ( oxRootId,
isroot,
thisRoot 
) [protected]

Recursivly updates root nodes, this method is used (only) in updateCategoryTree()

Parameters:
string $oxRootId rootid of tree
bool $isroot is the current node root?
string $thisRoot the id of the root
Returns:
null

Definition at line 553 of file oxcategorylist.php.

oxCategoryList.buildList ( blLoad  ) 

Fetches raw categories and does postprocessing for adding depth information

Parameters:
bool $blLoad usually used with config option bl_perfLoadCatTree
Returns:
null

Definition at line 282 of file oxcategorylist.php.

oxCategoryList.buildTree ( sActCat  ) 

Fetches reversed raw categories and does all necesarry postprocessing for removing invisible or forbidden categories, duilding oc navigation path, adding content categories and building tree structure.

Parameters:
string $sActCat Active category (default null)
Returns:
null

Definition at line 225 of file oxcategorylist.php.

oxCategoryList.getClickCat (  ) 

Getter for active category

Returns:
oxcategory

Definition at line 330 of file oxcategorylist.php.

oxCategoryList.getClickRoot (  ) 

Getter for active root category

Returns:
array of oxcategory

Definition at line 342 of file oxcategorylist.php.

oxCategoryList.getPath (  ) 

Getter for active category path

Returns:
array

Definition at line 320 of file oxcategorylist.php.

oxCategoryList.getUpdateInfo (  ) 

Returns update log data array

Returns:
array

Definition at line 539 of file oxcategorylist.php.

oxCategoryList.load (  ) 

Load category list data

Returns:
null

Definition at line 207 of file oxcategorylist.php.

oxCategoryList.setShopID ( sShopID  ) 

setter for shopID

Parameters:
int $sShopID ShopID
Returns:
null

Definition at line 310 of file oxcategorylist.php.

oxCategoryList.updateCategoryTree ( blVerbose = true,
sShopID = null 
)

Rebuilds nested sets information by updating oxleft and oxright category attributes, from oxparentid

Parameters:
bool $blVerbose Set to true for outputing the update status for user,
string $sShopID the shop id
Returns:
null

Definition at line 509 of file oxcategorylist.php.


Member Data Documentation

oxCategoryList.$_aPath = array() [protected]

Definition at line 45 of file oxcategorylist.php.

oxCategoryList.$_aUpdateInfo = array() [protected]

Definition at line 52 of file oxcategorylist.php.

oxCategoryList.$_blForceFull = false [protected]

Definition at line 31 of file oxcategorylist.php.

oxCategoryList.$_blHideEmpty = false [protected]

Definition at line 24 of file oxcategorylist.php.

oxCategoryList.$_sActCat = null [protected]

Definition at line 38 of file oxcategorylist.php.

oxCategoryList.$_sObjectsInListName = 'oxcategory' [protected]

Reimplemented from oxList.

Definition at line 17 of file oxcategorylist.php.


The documentation for this class was generated from the following file: