Category list manager. Collects available categories, performs some SQL queries to create category list structure.
◆ __construct()
OxidEsales\EshopCommunity\Application\Model\CategoryList::__construct |
( |
|
$sObjectsInListName = 'oxcategory' | ) |
|
Class constructor, initiates parent constructor (parent::oxList()).
- Parameters
-
string | $sObjectsInListName | optional parameter, the objects contained in the list, always oxCategory |
◆ __get()
OxidEsales\EshopCommunity\Application\Model\CategoryList::__get |
( |
|
$sName | ) |
|
Extra getter to guarantee compatibility with templates
- Parameters
-
string | $sName | variable name |
- Returns
- string
◆ _addDepthInfo()
OxidEsales\EshopCommunity\Application\Model\CategoryList::_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
◆ _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 | $oCat | selected 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 | $oCat | current category object |
array | $aColumns | required 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 | $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
◆ _getSqlSelectFieldsForTree()
OxidEsales\EshopCommunity\Application\Model\CategoryList::_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
◆ _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
-
◆ _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 | $oxRootId | rootid of tree |
bool | $isRoot | is the current node root? |
string | $thisRoot | the 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 | $sActCat | Active category (default null) |
◆ getActivityFieldsSql()
OxidEsales\EshopCommunity\Application\Model\CategoryList::getActivityFieldsSql |
( |
|
$tableName | ) |
|
|
protected |
Get activity related fields
- Parameters
-
- 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
-
- 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 |
( |
| ) |
|
◆ 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
-
◆ 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 | $blVerbose | Set to true for output the update status for user, |
string | $sShopID | the shop id |
◆ $_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: