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

Public Member Functions

 __construct ()
 
 getDefaultSorting ()
 
 getDefaultSortingMode ()
 
 __get ($sName)
 
 load ($sOXID)
 
 assign ($dbRecord)
 
 delete ($sOXID=null)
 
 getSubCats ()
 
 getSubCat ($sKey)
 
 setSubCats ($aCats)
 
 setSubCat ($oCat, $sKey=null)
 
 getContentCats ()
 
 setContentCats ($aContent)
 
 setContentCat ($oContent, $sKey=null)
 
 getNrOfArticles ()
 
 setNrOfArticles ($iNum)
 
 getIsVisible ()
 
 setIsVisible ($blVisible)
 
 getPictureUrl ()
 
 getBaseSeoLink ($iLang, $iPage=0)
 
 getLink ($iLang=null)
 
 setLink ($sLink)
 
 getSqlActiveSnippet ($blForceCoreTable=null)
 
 getBaseStdLink ($iLang, $blAddId=true, $blFull=true)
 
 getStdLink ($iLang=null, $aParams=[])
 
 getExpanded ()
 
 setExpanded ($blExpanded)
 
 getHasSubCats ()
 
 getHasVisibleSubCats ()
 
 setHasVisibleSubCats ($blHasVisibleSubcats)
 
 getAttributes ()
 
 getCatInLang ($oActCategory=null)
 
 setParentCategory ($oCategory)
 
 getParentCategory ()
 
 assignViewableRecord ($sSelect)
 
 getIconUrl ()
 
 getThumbUrl ()
 
 getPromotionIconUrl ()
 
 getPictureUrlForType ($sPicName, $sPicType)
 
 isTopCategory ()
 
 isPriceCategory ()
 
 getLongDesc ()
 
 getShortDescription ()
 
 getTitle ()
 
 getFieldFromSubCategories ($sField='OXID', $sOXID=null)
 

Static Public Member Functions

static getRootId ($sCategoryId)
 

Protected Member Functions

 _loadFromDb ($sOXID)
 
 getAdditionalSqlFilter ($forceCoreTable)
 
 _insert ()
 
 _update ()
 
 _setFieldData ($fieldName, $value, $dataType=\OxidEsales\Eshop\Core\Field::T_TEXT)
 

Protected Attributes

 $_aSubCats = []
 
 $_aContentCats = []
 
 $_sClassName = 'oxcategory'
 
 $_iNrOfArticles
 
 $_blIsVisible
 
 $_blExpanded
 
 $_blHasSubCats
 
 $_blHasVisibleSubCats
 
 $_blIsSeoObject = true
 
 $_blUseLazyLoading = false
 
 $_sDynImageDir = null
 
 $_blTopCategory = null
 
 $_aStdUrls = []
 
 $_aSeoUrls = []
 
 $_oParent = null
 

Static Protected Attributes

static $_aCatAttributes = []
 

Detailed Description

Category manager. Collects category information (articles, etc.), performs insertion/deletion of categories nodes. By recursion methods are set structure of category.

Constructor & Destructor Documentation

◆ __construct()

OxidEsales\EshopCommunity\Application\Model\Category::__construct ( )

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

Member Function Documentation

◆ __get()

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

Extra getter to guarantee compatibility with templates

Parameters
string$sNamename of variable to get
Returns
string

◆ _insert()

OxidEsales\EshopCommunity\Application\Model\Category::_insert ( )
protected

Inserts new category (and updates existing node oxLeft amd oxRight accordingly). Returns true on success.

Returns
bool
Deprecated:
underscore prefix violates PSR12, will be renamed to "insert" in next major

◆ _loadFromDb()

OxidEsales\EshopCommunity\Application\Model\Category::_loadFromDb (   $sOXID)
protected

Get data from db

Parameters
string$sOXIDid
Returns
array
Deprecated:
underscore prefix violates PSR12, will be renamed to "loadFromDb" in next major

◆ _setFieldData()

OxidEsales\EshopCommunity\Application\Model\Category::_setFieldData (   $fieldName,
  $value,
  $dataType = \OxidEsales\Eshop\Core\Field::T_TEXT 
)
protected

Sets data field value

Parameters
string$fieldNameindex OR name (eg. 'oxarticles__oxtitle') of a data field to set
string$valuevalue of data field
int$dataTypefield type
Returns
null
Deprecated:
underscore prefix violates PSR12, will be renamed to "setFieldData" in next major

◆ _update()

OxidEsales\EshopCommunity\Application\Model\Category::_update ( )
protected

Updates category tree, returns true on success.

Returns
bool
Deprecated:
underscore prefix violates PSR12, will be renamed to "update" in next major

◆ assign()

OxidEsales\EshopCommunity\Application\Model\Category::assign (   $dbRecord)

Loads and assigns object data from DB.

Parameters
mixed$dbRecorddatabase record array
Returns
null

◆ assignViewableRecord()

OxidEsales\EshopCommunity\Application\Model\Category::assignViewableRecord (   $sSelect)

Before assigning the record from SQL it checks for viewable rights

Parameters
string$sSelectSQL select
Returns
bool

◆ delete()

OxidEsales\EshopCommunity\Application\Model\Category::delete (   $sOXID = null)

Delete empty categories, returns true on success.

Parameters
string$sOXIDObject ID
Returns
bool

◆ getAdditionalSqlFilter()

OxidEsales\EshopCommunity\Application\Model\Category::getAdditionalSqlFilter (   $forceCoreTable)
protected

Additional SQL conditions for selecting articles snippet

Parameters
bool$forceCoreTable
Returns
string

◆ getAttributes()

OxidEsales\EshopCommunity\Application\Model\Category::getAttributes ( )

Loads and returns attribute list associated with this category

Returns
oxAttributeList

◆ getBaseSeoLink()

OxidEsales\EshopCommunity\Application\Model\Category::getBaseSeoLink (   $iLang,
  $iPage = 0 
)

Returns raw category seo url

Parameters
int$iLanglanguage id
int$iPagepage number [optional]
Returns
string

◆ getBaseStdLink()

OxidEsales\EshopCommunity\Application\Model\Category::getBaseStdLink (   $iLang,
  $blAddId = true,
  $blFull = true 
)

Returns base dynamic url: shopUrl/index.php?cl=details

Parameters
int$iLanglanguage id
bool$blAddIdadd current object id to url or not
bool$blFullreturn full including domain name [optional]
Returns
string

◆ getCatInLang()

OxidEsales\EshopCommunity\Application\Model\Category::getCatInLang (   $oActCategory = null)

Loads and returns category in base language

Parameters
object$oActCategoryactive category
Returns
object

◆ getContentCats()

OxidEsales\EshopCommunity\Application\Model\Category::getContentCats ( )

returns the content category array

Returns
array

◆ getDefaultSorting()

OxidEsales\EshopCommunity\Application\Model\Category::getDefaultSorting ( )

Gets default sorting value

Returns
string

◆ getDefaultSortingMode()

OxidEsales\EshopCommunity\Application\Model\Category::getDefaultSortingMode ( )

Gets default sorting mode value

Returns
string

◆ getExpanded()

OxidEsales\EshopCommunity\Application\Model\Category::getExpanded ( )

returns the expanded state of the category

Returns
bool

◆ getFieldFromSubCategories()

OxidEsales\EshopCommunity\Application\Model\Category::getFieldFromSubCategories (   $sField = 'OXID',
  $sOXID = null 
)

Gets one field from all of subcategories. Default is set to 'OXID'

Parameters
string$sFieldfield to be retrieved from each subcategory
string$sOXIDCetegory ID
Returns
array

◆ getHasSubCats()

OxidEsales\EshopCommunity\Application\Model\Category::getHasSubCats ( )

returns if a category has sub categories

Returns
bool

◆ getHasVisibleSubCats()

OxidEsales\EshopCommunity\Application\Model\Category::getHasVisibleSubCats ( )

returns if a category has visible sub categories

Returns
bool

◆ getIconUrl()

OxidEsales\EshopCommunity\Application\Model\Category::getIconUrl ( )

Returns category icon picture url if exist, false - if not

Returns
mixed

◆ getIsVisible()

OxidEsales\EshopCommunity\Application\Model\Category::getIsVisible ( )

returns the visibility of a category, handles hidden and empty categories

Returns
bool

◆ getLink()

OxidEsales\EshopCommunity\Application\Model\Category::getLink (   $iLang = null)

returns the url of the category

Parameters
int$iLanglanguage id
Returns
string

◆ getLongDesc()

OxidEsales\EshopCommunity\Application\Model\Category::getLongDesc ( )

Returns long description, parsed through smarty. should only be used by exports or so. In templates use [{oxeval var=$oCategory->oxcategories__oxlongdesc->getRawValue()}]

Returns
string

◆ getNrOfArticles()

OxidEsales\EshopCommunity\Application\Model\Category::getNrOfArticles ( )

returns number or articles in category

Returns
integer

◆ getParentCategory()

OxidEsales\EshopCommunity\Application\Model\Category::getParentCategory ( )

Returns parent category object for current category (if it is available).

Returns
\OxidEsales\Eshop\Application\Model\Category

◆ getPictureUrl()

OxidEsales\EshopCommunity\Application\Model\Category::getPictureUrl ( )

Returns dyn image dir

Returns
string

◆ getPictureUrlForType()

OxidEsales\EshopCommunity\Application\Model\Category::getPictureUrlForType (   $sPicName,
  $sPicType 
)

Returns category picture url if exist, false - if not

Parameters
string$sPicNamepicture name
string$sPicTypepicture type related with picture dir: icon - icon; 0 - image
Returns
mixed

◆ getPromotionIconUrl()

OxidEsales\EshopCommunity\Application\Model\Category::getPromotionIconUrl ( )

Returns category promotion icon picture url if exist, false - if not

Returns
mixed

◆ getRootId()

static OxidEsales\EshopCommunity\Application\Model\Category::getRootId (   $sCategoryId)
static

Returns root category id of a child category

Parameters
string$sCategoryIdcategory id
Returns
integer

◆ getShortDescription()

OxidEsales\EshopCommunity\Application\Model\Category::getShortDescription ( )

Returns short description

Returns
string

◆ getSqlActiveSnippet()

OxidEsales\EshopCommunity\Application\Model\Category::getSqlActiveSnippet (   $blForceCoreTable = null)

Returns SQL select string with checks if items are available

Parameters
bool$blForceCoreTableforces core table usage (optional)
Returns
string

◆ getStdLink()

OxidEsales\EshopCommunity\Application\Model\Category::getStdLink (   $iLang = null,
  $aParams = [] 
)

Returns standard URL to category

Parameters
int$iLanglanguage
array$aParamsadditional params to use [optional]
Returns
string

◆ getSubCat()

OxidEsales\EshopCommunity\Application\Model\Category::getSubCat (   $sKey)

returns a specific sub category

Parameters
string$sKeythe key of the category
Returns
object

◆ getSubCats()

OxidEsales\EshopCommunity\Application\Model\Category::getSubCats ( )

returns the sub category array

Returns
array

◆ getThumbUrl()

OxidEsales\EshopCommunity\Application\Model\Category::getThumbUrl ( )

Returns category thumbnail picture url if exist, false - if not

Returns
mixed

◆ getTitle()

OxidEsales\EshopCommunity\Application\Model\Category::getTitle ( )

Returns category title

Returns
string

◆ isPriceCategory()

OxidEsales\EshopCommunity\Application\Model\Category::isPriceCategory ( )

Returns true if current category is price type ( ( oxpricefrom || oxpriceto ) > 0 )

Returns
bool

◆ isTopCategory()

OxidEsales\EshopCommunity\Application\Model\Category::isTopCategory ( )

Returns true if category parentid is 'oxrootid'

Returns
bool

◆ load()

OxidEsales\EshopCommunity\Application\Model\Category::load (   $sOXID)

Load category data

Parameters
string$sOXIDid
Returns
bool

◆ setContentCat()

OxidEsales\EshopCommunity\Application\Model\Category::setContentCat (   $oContent,
  $sKey = null 
)

sets a single category

Parameters
\OxidEsales\Eshop\Application\Model\Category$oContentthe category
string$sKeyoptional, the key for that category, without a key, the category is just added to the array

◆ setContentCats()

OxidEsales\EshopCommunity\Application\Model\Category::setContentCats (   $aContent)

Sets an array of content categories

Parameters
array$aContentarray of content

◆ setExpanded()

OxidEsales\EshopCommunity\Application\Model\Category::setExpanded (   $blExpanded)

set the expanded state of the category

Parameters
bool$blExpandedexpanded status setter

◆ setHasVisibleSubCats()

OxidEsales\EshopCommunity\Application\Model\Category::setHasVisibleSubCats (   $blHasVisibleSubcats)

sets the state of has visible sub categories for the category

Parameters
bool$blHasVisibleSubcatsmarker if category has visible subcategories

◆ setIsVisible()

OxidEsales\EshopCommunity\Application\Model\Category::setIsVisible (   $blVisible)

sets the visibility of a category

Parameters
bool$blVisiblecategory visibility status setter

◆ setLink()

OxidEsales\EshopCommunity\Application\Model\Category::setLink (   $sLink)

sets the url of the category

Parameters
string$sLinkcategory url

◆ setNrOfArticles()

OxidEsales\EshopCommunity\Application\Model\Category::setNrOfArticles (   $iNum)

sets the number or articles in category

Parameters
int$iNumcategory product count setter

◆ setParentCategory()

OxidEsales\EshopCommunity\Application\Model\Category::setParentCategory (   $oCategory)

Set parent category object for internal usage only.

Parameters
\OxidEsales\Eshop\Application\Model\Category$oCategoryparent category object

◆ setSubCat()

OxidEsales\EshopCommunity\Application\Model\Category::setSubCat (   $oCat,
  $sKey = null 
)

sets a single category, handles sorting and parent hasVisibleSubCats

Parameters
\OxidEsales\Eshop\Application\Model\Category$oCatthe category
string$sKey(optional, default=null) the key for that category, without a key, the category is just added to the array

◆ setSubCats()

OxidEsales\EshopCommunity\Application\Model\Category::setSubCats (   $aCats)

Sets an array of sub categories, also handles parent hasVisibleSubCats

Parameters
array$aCatsarray of categories

Member Data Documentation

◆ $_aCatAttributes

OxidEsales\EshopCommunity\Application\Model\Category::$_aCatAttributes = []
staticprotected

◆ $_aContentCats

OxidEsales\EshopCommunity\Application\Model\Category::$_aContentCats = []
protected

◆ $_aSeoUrls

OxidEsales\EshopCommunity\Application\Model\Category::$_aSeoUrls = []
protected

◆ $_aStdUrls

OxidEsales\EshopCommunity\Application\Model\Category::$_aStdUrls = []
protected

◆ $_aSubCats

OxidEsales\EshopCommunity\Application\Model\Category::$_aSubCats = []
protected

◆ $_blExpanded

OxidEsales\EshopCommunity\Application\Model\Category::$_blExpanded
protected

◆ $_blHasSubCats

OxidEsales\EshopCommunity\Application\Model\Category::$_blHasSubCats
protected

◆ $_blHasVisibleSubCats

OxidEsales\EshopCommunity\Application\Model\Category::$_blHasVisibleSubCats
protected

◆ $_blIsSeoObject

OxidEsales\EshopCommunity\Application\Model\Category::$_blIsSeoObject = true
protected

◆ $_blIsVisible

OxidEsales\EshopCommunity\Application\Model\Category::$_blIsVisible
protected

◆ $_blTopCategory

OxidEsales\EshopCommunity\Application\Model\Category::$_blTopCategory = null
protected

◆ $_blUseLazyLoading

OxidEsales\EshopCommunity\Application\Model\Category::$_blUseLazyLoading = false
protected

◆ $_iNrOfArticles

OxidEsales\EshopCommunity\Application\Model\Category::$_iNrOfArticles
protected

◆ $_oParent

OxidEsales\EshopCommunity\Application\Model\Category::$_oParent = null
protected

◆ $_sClassName

OxidEsales\EshopCommunity\Application\Model\Category::$_sClassName = 'oxcategory'
protected

◆ $_sDynImageDir

OxidEsales\EshopCommunity\Application\Model\Category::$_sDynImageDir = null
protected

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