Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

oxCategory Class Reference

Inheritance diagram for oxCategory:
Collaboration diagram for oxCategory:

List of all members.

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=array())
 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)
 _insert ()
 _update ()
 _setFieldData ($sFieldName, $sValue, $iDataType=oxField::T_TEXT)

Protected Attributes

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

Static Protected Attributes

static $_aCatAttributes = array()

Detailed Description

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

Definition at line 9 of file oxcategory.php.


Constructor & Destructor Documentation

oxCategory.__construct (  ) 

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

Definition at line 127 of file oxcategory.php.


Member Function Documentation

oxCategory.__get ( sName  ) 

Extra getter to guarantee compatibility with templates

Parameters:
string $sName name of variable to get
Returns:
string

Definition at line 160 of file oxcategory.php.

oxCategory._insert (  )  [protected]

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

Returns:
bool

Definition at line 808 of file oxcategory.php.

oxCategory._loadFromDb ( sOXID  )  [protected]

Get data from db

Parameters:
string $sOXID id
Returns:
array

Definition at line 206 of file oxcategory.php.

oxCategory._setFieldData ( sFieldName,
sValue,
iDataType = oxField::T_TEXT 
) [protected]

Sets data field value

Parameters:
string $sFieldName index OR name (eg. 'oxarticles__oxtitle') of a data field to set
string $sValue value of data field
int $iDataType field type
Returns:
null

Definition at line 972 of file oxcategory.php.

oxCategory._update (  )  [protected]

Updates category tree, returns true on success.

Returns:
bool

Definition at line 867 of file oxcategory.php.

oxCategory.assign ( dbRecord  ) 

Loads and assigns object data from DB.

Parameters:
mixed $dbRecord database record array
Returns:
null

Definition at line 243 of file oxcategory.php.

oxCategory.assignViewableRecord ( sSelect  ) 

Before assigning the record from SQL it checks for viewable rights

Parameters:
string $sSelect SQL select
Returns:
bool

Definition at line 793 of file oxcategory.php.

oxCategory.delete ( sOXID = null  ) 

Delete empty categories, returns true on success.

Parameters:
string $sOXID Object ID
Returns:
bool

Definition at line 257 of file oxcategory.php.

oxCategory.getAttributes (  ) 

Loads and returns attribute list associated with this category

Returns:
array

Definition at line 694 of file oxcategory.php.

oxCategory.getBaseSeoLink ( iLang,
iPage = 0 
)

Returns raw category seo url

Parameters:
int $iLang language id
int $iPage page number [optional]
Returns:
string

Definition at line 506 of file oxcategory.php.

oxCategory.getBaseStdLink ( iLang,
blAddId = true,
blFull = true 
)

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

Parameters:
int $iLang language id
bool $blAddId add current object id to url or not
bool $blFull return full including domain name [optional]
Returns:
string

Implements oxIUrl.

Definition at line 584 of file oxcategory.php.

oxCategory.getCatInLang ( oActCategory = null  ) 

Loads and returns category in base language

Parameters:
object $oActCategory active category
Returns:
object

Definition at line 715 of file oxcategory.php.

oxCategory.getContentCats (  ) 

returns the content category array

Returns:
array

Definition at line 385 of file oxcategory.php.

oxCategory.getDefaultSorting (  ) 

Gets default sorting value

Returns:
string

Definition at line 138 of file oxcategory.php.

oxCategory.getDefaultSortingMode (  ) 

Gets default sorting mode value

Returns:
string

Definition at line 148 of file oxcategory.php.

oxCategory.getExpanded (  ) 

returns the expanded state of the category

Returns:
bool

Definition at line 630 of file oxcategory.php.

oxCategory.getFieldFromSubCategories ( sField = 'OXID',
sOXID = null 
)

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

Parameters:
string $sField field to be retrieved from each subcategory
string $sOXID Cetegory ID
Returns:
array

Definition at line 1114 of file oxcategory.php.

oxCategory.getHasSubCats (  ) 

returns if a category has sub categories

Returns:
bool

Definition at line 650 of file oxcategory.php.

oxCategory.getHasVisibleSubCats (  ) 

returns if a category has visible sub categories

Returns:
bool

Definition at line 664 of file oxcategory.php.

oxCategory.getIconUrl (  ) 

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

Returns:
mixed

Definition at line 990 of file oxcategory.php.

oxCategory.getIsVisible (  ) 

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

Returns:
bool

Definition at line 457 of file oxcategory.php.

oxCategory.getLink ( iLang = null  ) 

returns the url of the category

Parameters:
int $iLang language id
Returns:
string

Implements oxIUrl.

Definition at line 523 of file oxcategory.php.

oxCategory.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

Definition at line 1078 of file oxcategory.php.

oxCategory.getNrOfArticles (  ) 

returns number or articles in category

Returns:
integer

Definition at line 420 of file oxcategory.php.

oxCategory.getParentCategory (  ) 

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

Returns:
oxCategory

Definition at line 745 of file oxcategory.php.

oxCategory.getPictureUrl (  ) 

Returns dyn image dir

Returns:
string

Definition at line 488 of file oxcategory.php.

oxCategory.getPictureUrlForType ( sPicName,
sPicType 
)

Returns category picture url if exist, false - if not

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

Definition at line 1039 of file oxcategory.php.

oxCategory.getPromotionIconUrl (  ) 

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

Returns:
mixed

Definition at line 1022 of file oxcategory.php.

static oxCategory.getRootId ( sCategoryId  )  [static]

Returns root category id of a child category

Parameters:
string $sCategoryId category id
Returns:
integer

Definition at line 775 of file oxcategory.php.

oxCategory.getShortDescription (  ) 

Returns short description

Returns:
string

Definition at line 1090 of file oxcategory.php.

oxCategory.getSqlActiveSnippet ( blForceCoreTable = null  ) 

Returns SQL select string with checks if items are available

Parameters:
bool $blForceCoreTable forces core table usage (optional)
Returns:
string

Definition at line 564 of file oxcategory.php.

oxCategory.getStdLink ( iLang = null,
aParams = array() 
)

Returns standard URL to category

Parameters:
int $iLang language
array $aParams additional params to use [optional]
Returns:
string

Implements oxIUrl.

Definition at line 608 of file oxcategory.php.

oxCategory.getSubCat ( sKey  ) 

returns a specific sub category

Parameters:
string $sKey the key of the category
Returns:
object

Definition at line 333 of file oxcategory.php.

oxCategory.getSubCats (  ) 

returns the sub category array

Returns:
array

Definition at line 321 of file oxcategory.php.

oxCategory.getThumbUrl (  ) 

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

Returns:
mixed

Definition at line 1008 of file oxcategory.php.

oxCategory.getTitle (  ) 

Returns category title

Returns:
string

Definition at line 1100 of file oxcategory.php.

oxCategory.isPriceCategory (  ) 

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

Returns:
bool

Definition at line 1067 of file oxcategory.php.

oxCategory.isTopCategory (  ) 

Returns true is category parent id is 'oxrootid'

Returns:
bool

Definition at line 1053 of file oxcategory.php.

oxCategory.load ( sOXID  ) 

Load category data

Parameters:
string $sOXID id
Returns:
null

Definition at line 221 of file oxcategory.php.

oxCategory.setContentCat ( oContent,
sKey = null 
)

sets a single category

Parameters:
oxCategory $oContent the category
string $sKey optional, the key for that category, without a key, the category is just added to the array

Definition at line 406 of file oxcategory.php.

oxCategory.setContentCats ( aContent  ) 

Sets an array of content categories

Parameters:
array $aContent array of content

Definition at line 395 of file oxcategory.php.

oxCategory.setExpanded ( blExpanded  ) 

set the expanded state of the category

Parameters:
bool $blExpanded expanded status setter

Definition at line 640 of file oxcategory.php.

oxCategory.setHasVisibleSubCats ( blHasVisibleSubcats  ) 

sets the state of has visible sub categories for the category

Parameters:
bool $blHasVisibleSubcats marker if category has visible subcategories

Definition at line 678 of file oxcategory.php.

oxCategory.setIsVisible ( blVisible  ) 

sets the visibility of a category

Parameters:
bool $blVisible category visibility status setter

Definition at line 478 of file oxcategory.php.

oxCategory.setLink ( sLink  ) 

sets the url of the category

Parameters:
string $sLink category url

Definition at line 547 of file oxcategory.php.

oxCategory.setNrOfArticles ( iNum  ) 

sets the number or articles in category

Parameters:
int $iNum category product count setter

Definition at line 447 of file oxcategory.php.

oxCategory.setParentCategory ( oCategory  ) 

Set parent category object for internal usage only.

Parameters:
oxCategory $oCategory parent category object

Definition at line 735 of file oxcategory.php.

oxCategory.setSubCat ( oCat,
sKey = null 
)

sets a single category, handles sorting and parent hasVisibleSubCats

Parameters:
oxCategory $oCat the category
string $sKey (optional, default=null) the key for that category, without a key, the category is just added to the array

Definition at line 364 of file oxcategory.php.

oxCategory.setSubCats ( aCats  ) 

Sets an array of sub categories, also handles parent hasVisibleSubCats

Parameters:
array $aCats array of categories

Definition at line 343 of file oxcategory.php.


Member Data Documentation

oxCategory.$_aCatAttributes = array() [static, protected]

Definition at line 115 of file oxcategory.php.

oxCategory.$_aContentCats = array() [protected]

Definition at line 24 of file oxcategory.php.

oxCategory.$_aSeoUrls = array() [protected]

Definition at line 108 of file oxcategory.php.

oxCategory.$_aStdUrls = array() [protected]

Definition at line 101 of file oxcategory.php.

oxCategory.$_aSubCats = array() [protected]

Definition at line 17 of file oxcategory.php.

oxCategory.$_blExpanded [protected]

Definition at line 52 of file oxcategory.php.

oxCategory.$_blHasSubCats [protected]

Definition at line 59 of file oxcategory.php.

oxCategory.$_blHasVisibleSubCats [protected]

Definition at line 66 of file oxcategory.php.

oxCategory.$_blIsSeoObject = true [protected]

Definition at line 73 of file oxcategory.php.

oxCategory.$_blIsVisible [protected]

Definition at line 45 of file oxcategory.php.

oxCategory.$_blTopCategory = null [protected]

Definition at line 94 of file oxcategory.php.

oxCategory.$_blUseLazyLoading = false [protected]

Definition at line 80 of file oxcategory.php.

oxCategory.$_iNrOfArticles [protected]

Definition at line 38 of file oxcategory.php.

oxCategory.$_oParent = null [protected]

Definition at line 122 of file oxcategory.php.

oxCategory.$_sClassName = 'oxcategory' [protected]

Definition at line 31 of file oxcategory.php.

oxCategory.$_sDynImageDir = null [protected]

Definition at line 87 of file oxcategory.php.


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