OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Application\Model\CategoryList Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Application\Model\CategoryList:
+ Collaboration diagram for OxidEsales\EshopCommunity\Application\Model\CategoryList:

Public Member Functions

 __construct ($sObjectsInListName='oxcategory')
 
 setLoadFull ($blForceFull)
 
 getLoadFull ()
 
 setLoadLevel ($iForceLevel)
 
 getLoadLevel ()
 
 load ()
 
 buildTree ($sActCat)
 
 loadList ()
 
 setShopID ($sShopID)
 
 getPath ()
 
 getClickCat ()
 
 getClickRoot ()
 
 updateCategoryTree ($blVerbose=true, $sShopID=null)
 
 getUpdateInfo ()
 
 __get ($sName)
 

Protected Member Functions

 _getSqlSelectFieldsForTree ($sTable, $aColumns=null)
 
 getActivityFieldsSql ($tableName)
 
 _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="")
 
 onUpdateCategoryTree ()
 
 getInitialUpdateCategoryTreeCondition ($blVerbose=false)
 
 _updateNodes ($oxRootId, $isRoot, $thisRoot)
 

Protected Attributes

 $_sObjectsInListName = 'oxcategory'
 
 $_blHideEmpty = false
 
 $_blForceFull = false
 
 $_iForceLevel = 2
 
 $_sActCat = null
 
 $_aPath = []
 
 $_aUpdateInfo = []
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

OxidEsales\EshopCommunity\Application\Model\CategoryList::__construct (   $sObjectsInListName = 'oxcategory')

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

Parameters
string$sObjectsInListNameoptional parameter, the objects contained in the list, always oxCategory

Member Function Documentation

◆ __get()

OxidEsales\EshopCommunity\Application\Model\CategoryList::__get (   $sName)

Extra getter to guarantee compatibility with templates

Parameters
string$sNamevariable name
Returns
string

◆ _addDepthInfo()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_addDepthInfo (   $aTree,
  $oCat,
  $sDepth = "" 
)
protected

Recursive function to add depth information

Parameters
array$aTreenew category tree
object$oCatcategory object
string$sDepthstring to show category depth
Returns
array $aTree

◆ _getDepthSqlSnippet()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_getDepthSqlSnippet (   $oCat)
protected

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

Parameters
\OxidEsales\Eshop\Application\Model\Category$oCatselected category
Returns
string

◆ _getDepthSqlUnion()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_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 category, and parents and grandparents etc)

Parameters
\OxidEsales\Eshop\Application\Model\Category$oCatcurrent category object
array$aColumnsrequired column names (optional)
Returns
string

◆ _getSelectString()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_getSelectString (   $blReverse = false,
  $aColumns = null,
  $sOrder = null 
)
protected

constructs the sql string to get the category list

Parameters
bool$blReverselist loading order, true for tree, false for simple list (optional, default false)
array$aColumnsrequired column names (optional)
string$sOrderorder by string (optional)
Returns
string

◆ _getSqlSelectFieldsForTree()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_getSqlSelectFieldsForTree (   $sTable,
  $aColumns = null 
)
protected

return fields to select while loading category tree

Parameters
string$sTabletable name
array$aColumnsrequired column names (optional)
Returns
string return

◆ _loadFromDb()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_loadFromDb ( )
protected

Get data from db

Returns
array

◆ _ppAddContentCategories()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_ppAddContentCategories ( )
protected

Category list postprocessing routine, responsible adding of content categories

◆ _ppAddDepthInformation()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_ppAddDepthInformation ( )
protected

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

◆ _ppAddPathInfo()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_ppAddPathInfo ( )
protected

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

Returns
null

◆ _ppBuildTree()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_ppBuildTree ( )
protected

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

◆ _ppLoadFullCategory()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_ppLoadFullCategory (   $sId)
protected

set full category object in tree

Parameters
string$sIdcategory id

◆ _ppRemoveInactiveCategories()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_ppRemoveInactiveCategories ( )
protected

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

◆ _updateNodes()

OxidEsales\EshopCommunity\Application\Model\CategoryList::_updateNodes (   $oxRootId,
  $isRoot,
  $thisRoot 
)
protected

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

Parameters
string$oxRootIdrootid of tree
bool$isRootis the current node root?
string$thisRootthe id of the root

◆ buildTree()

OxidEsales\EshopCommunity\Application\Model\CategoryList::buildTree (   $sActCat)

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

Parameters
string$sActCatActive category (default null)

◆ getActivityFieldsSql()

OxidEsales\EshopCommunity\Application\Model\CategoryList::getActivityFieldsSql (   $tableName)
protected

Get activity related fields

Parameters
string$tableName
Returns
string SQL snippet

◆ getClickCat()

OxidEsales\EshopCommunity\Application\Model\CategoryList::getClickCat ( )

Getter for active category

Returns
\OxidEsales\Eshop\Application\Model\Category

◆ getClickRoot()

OxidEsales\EshopCommunity\Application\Model\CategoryList::getClickRoot ( )

Getter for active root category

Returns
array of oxCategory

◆ getInitialUpdateCategoryTreeCondition()

OxidEsales\EshopCommunity\Application\Model\CategoryList::getInitialUpdateCategoryTreeCondition (   $blVerbose = false)
protected

Get Initial updateCategoryTree sql condition

Parameters
bool$blVerbose
Returns
string

◆ getLoadFull()

OxidEsales\EshopCommunity\Application\Model\CategoryList::getLoadFull ( )

Return true if load full tree

Returns
boolean

◆ getLoadLevel()

OxidEsales\EshopCommunity\Application\Model\CategoryList::getLoadLevel ( )

Returns tree load level

Returns
integer

◆ getPath()

OxidEsales\EshopCommunity\Application\Model\CategoryList::getPath ( )

Getter for active category path

Returns
array

◆ getUpdateInfo()

OxidEsales\EshopCommunity\Application\Model\CategoryList::getUpdateInfo ( )

Returns update log data array

Returns
array

◆ load()

OxidEsales\EshopCommunity\Application\Model\CategoryList::load ( )

Load category list data

◆ loadList()

OxidEsales\EshopCommunity\Application\Model\CategoryList::loadList ( )

Fetches raw categories and does postprocessing for adding depth information

◆ onUpdateCategoryTree()

OxidEsales\EshopCommunity\Application\Model\CategoryList::onUpdateCategoryTree ( )
protected

Triggering in the end of updateCategoryTree method

◆ setLoadFull()

OxidEsales\EshopCommunity\Application\Model\CategoryList::setLoadFull (   $blForceFull)

Set how to load tree true - for full tree

Parameters
boolean$blForceFull- true to load full

◆ setLoadLevel()

OxidEsales\EshopCommunity\Application\Model\CategoryList::setLoadLevel (   $iForceLevel)

Set tree level 1- load root or 2 - root and second level

Parameters
int$iForceLevel- level number

◆ setShopID()

OxidEsales\EshopCommunity\Application\Model\CategoryList::setShopID (   $sShopID)

setter for shopID

Parameters
int$sShopIDShopID

◆ updateCategoryTree()

OxidEsales\EshopCommunity\Application\Model\CategoryList::updateCategoryTree (   $blVerbose = true,
  $sShopID = null 
)

Rebuilds nested sets information by updating oxLeft and oxRight category attributes, from oxParentId

Parameters
bool$blVerboseSet to true for output the update status for user,
string$sShopIDthe shop id

Member Data Documentation

◆ $_aPath

OxidEsales\EshopCommunity\Application\Model\CategoryList::$_aPath = []
protected

◆ $_aUpdateInfo

OxidEsales\EshopCommunity\Application\Model\CategoryList::$_aUpdateInfo = []
protected

◆ $_blForceFull

OxidEsales\EshopCommunity\Application\Model\CategoryList::$_blForceFull = false
protected

◆ $_blHideEmpty

OxidEsales\EshopCommunity\Application\Model\CategoryList::$_blHideEmpty = false
protected

◆ $_iForceLevel

OxidEsales\EshopCommunity\Application\Model\CategoryList::$_iForceLevel = 2
protected

◆ $_sActCat

OxidEsales\EshopCommunity\Application\Model\CategoryList::$_sActCat = null
protected

◆ $_sObjectsInListName

OxidEsales\EshopCommunity\Application\Model\CategoryList::$_sObjectsInListName = 'oxcategory'
protected

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