VirtueMart  3.2.14.9808
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
VirtueMartModelCategory Class Reference
Inheritance diagram for VirtueMartModelCategory:
Inheritance graph
[legend]
Collaboration diagram for VirtueMartModelCategory:
Collaboration graph
[legend]

Public Member Functions

 __construct ()
 
 checkIfCached ($virtuemart_category_id, $childs=TRUE)
 
 getCategory ($virtuemart_category_id=0, $childs=TRUE, $fe=true)
 
 getChildCategoryList ($vendorId, $virtuemart_category_id, $selectedOrdering=null, $orderDir=null, $useCache=true)
 
 getCategoryTree ($parentId=0, $level=0, $onlyPublished=true, $keyword= '', $limitStart= '', $limit= '')
 
 rekurseCats ($virtuemart_category_id, $level, $onlyPublished, $keyword, &$sortedCats, $deep=0)
 
 getCategories ($onlyPublished=true, $parentId=false, $childId=false, $keyword="", $vendorId=false)
 
 countProducts ($cat_id=0)
 
 orderCategory ($id, $movement)
 
 setOrder ($cats, $order)
 
 getParentCategory ($categoryId=0)
 
 getRelationInfo ($virtuemart_category_id=0)
 
 store (&$data)
 
 remove ($cids)
 
 clearCategoryRelatedCaches ()
 
 hasChildren ($virtuemart_category_id)
 
 getParentsList ($virtuemart_category_id)
 
 getCategoryRecurse ($virtuemart_category_id, $catMenuId, $idsArr=true)
 
 toggle ($field, $val=NULL, $cidname=0, $tablename=0, $view=false)
 
- Public Member Functions inherited from VmModel
 __construct ($cidName='cid', $config=array())
 
 setDebugSql ($b)
 
 getName ()
 
 setState ($property, $value=null)
 
 getState ($property=null, $default=null)
 
 getTable ($name= '', $prefix= 'Table', $options=array())
 
 setIdName ($idName)
 
 getIdName ()
 
 getId ()
 
 setId ($id)
 
 setMainTable ($maintablename, $maintable=0)
 
 getDefaultOrdering ()
 
 addvalidOrderingFieldName ($add)
 
 removevalidOrderingFieldName ($name)
 
 setDefaultValidOrderingFields ($defaultTable=null)
 
 _getOrdering ($preTable='')
 
 checkFilterOrder ($toCheck, $view=0, $task= '')
 
 checkValidOrderingFieldName ($toCheck)
 
 checkFilterDir ($toCheck, $view=0, $task= '')
 
 getPagination ($perRow=5)
 
 setPaginationLimits ()
 
 getTotal ()
 
 setGetCount ($withCount)
 
 exeSortSearchListQuery ($object, $select, $joinedTables, $whereString= '', $groupBy= '', $orderBy= '', $filter_order_Dir= '', $nbrReturnProducts=false)
 
 emptyCache ()
 
 getData ($id=0)
 
 store (&$data)
 
 remove ($ids)
 
 setToggleName ($togglesName)
 
 toggle ($field, $val=NULL, $cidname=0, $tablename=0, $view=false)
 
 move ($direction, $filter=null)
 
 saveorder ($cid=array(), $order, $filter=null)
 
 addImages ($obj, $limit=0)
 
 resetErrors ()
 
- Public Member Functions inherited from vObject
 __toString ()
 
 get ($prop, $def=null)
 
 set ($prop, $value=null)
 
 setProperties ($props)
 

Static Public Member Functions

static getChildCategoryListObject ($vendorId, $virtuemart_category_id, $selectedOrdering=null, $orderDir=null, $lang=false)
 
- Static Public Member Functions inherited from VmModel
static addTablePath ($path)
 
static addIncludePath ($path= '', $prefix= '')
 
static getInstance ($type, $prefix= '', $config=array())
 
static getModel ($name=false)
 
static joinLangTables ($tablename, $prefix, $on, $method=0)
 
static joinLangSelectFields ($langFields, $as=true)
 
static joinLangLikeFields ($langFields, $keyword)
 
static joinLangLikeField ($searchField, $keyword)
 

Public Attributes

 $_cleanCache = true
 
- Public Attributes inherited from VmModel
 $_id = 0
 
 $_data = null
 
 $_query = null
 
 $_total = null
 
 $_pagination = 0
 
 $_limit = 0
 
 $_limitStart = 0
 
 $_maintable = ''
 
 $_maintablename = ''
 
 $_idName = ''
 
 $_cidName = 'cid'
 
 $_togglesName = null
 
 $_selectedOrderingDir = 'DESC'
 
 $_noLimit = false
 
 $_tablePreFix = ''
 
 $_validOrderingFieldName = array()
 
 $_validFilterDir = array('ASC','DESC')
 

Static Public Attributes

static $_validOrderingFields = array('category_name','c.ordering,category_name','category_description','c.category_shared','c.published')
 

Private Attributes

 $_category_tree
 
 $categoryRecursed = 0
 

Additional Inherited Members

- Protected Member Functions inherited from VmModel
 populateState ()
 
 _createTable ($name, $prefix= 'Table', $config=array())
 
 _getList ($query, $limitstart=0, $limit=0)
 
 _getListCount ($query)
 
- Static Protected Member Functions inherited from VmModel
static _createFileName ($type, $parts=array())
 
- Protected Attributes inherited from VmModel
 $__state_set = null
 
 $name
 
 $option = null
 
 $state
 
 $event_clean_cache = null
 
 $_maxItems = 1000
 

Detailed Description

Model for product categories

Constructor & Destructor Documentation

VirtueMartModelCategory::__construct ( )

constructs a VmModel setMainTable defines the maintable of the model

Member Function Documentation

VirtueMartModelCategory::checkIfCached (   $virtuemart_category_id,
  $childs = TRUE 
)
VirtueMartModelCategory::clearCategoryRelatedCaches ( )
VirtueMartModelCategory::countProducts (   $cat_id = 0)

count the products in a category

Author
Max Milbers
Returns
array list of categories product is in
VirtueMartModelCategory::getCategories (   $onlyPublished = true,
  $parentId = false,
  $childId = false,
  $keyword = "",
  $vendorId = false 
)
VirtueMartModelCategory::getCategory (   $virtuemart_category_id = 0,
  $childs = TRUE,
  $fe = true 
)

Retrieve the detail record for the current $id if the data has not already been loaded.

Author
RickG, jseros, Max Milbers
VirtueMartModelCategory::getCategoryRecurse (   $virtuemart_category_id,
  $catMenuId,
  $idsArr = true 
)
VirtueMartModelCategory::getCategoryTree (   $parentId = 0,
  $level = 0,
  $onlyPublished = true,
  $keyword = '',
  $limitStart = '',
  $limit = '' 
)
VirtueMartModelCategory::getChildCategoryList (   $vendorId,
  $virtuemart_category_id,
  $selectedOrdering = null,
  $orderDir = null,
  $useCache = true 
)

Get the list of child categories for a given category, is cached

Parameters
int$virtuemart_category_idCategory id to check for child categories
Returns
object List of objects containing the child categories
static VirtueMartModelCategory::getChildCategoryListObject (   $vendorId,
  $virtuemart_category_id,
  $selectedOrdering = null,
  $orderDir = null,
  $lang = false 
)
static

Be aware we need the lang to assure that the cache works properly. The cache needs all parameters in the function call to use the right hash

Author
Max Milbers
Parameters
$vendorId
$virtuemart_category_id
null$selectedOrdering
null$orderDir
$lang
Returns
mixed
VirtueMartModelCategory::getParentCategory (   $categoryId = 0)

Retrieve the detail record for the parent category of $categoryd

Author
jseros
Parameters
int$categoryIdChild category id
Returns
JTable parent category data
VirtueMartModelCategory::getParentsList (   $virtuemart_category_id)

Creates a bulleted of the childen of this category if they exist

Parameters
int$virtuemart_category_idthe category ID to create the list of
Returns
array containing the child categories
VirtueMartModelCategory::getRelationInfo (   $virtuemart_category_id = 0)

Retrieve category child-parent relation record

Author
jseros
Parameters
int$virtuemart_category_id
Returns
object Record of parent relation
VirtueMartModelCategory::hasChildren (   $virtuemart_category_id)

Checks for children of the category $virtuemart_category_id

Parameters
int$virtuemart_category_idthe category ID to check
Returns
boolean true when the category has childs, false when not
VirtueMartModelCategory::orderCategory (   $id,
  $movement 
)

Order any category

Author
jseros
Parameters
int$idcategory id
int$movementmovement number
Returns
bool
VirtueMartModelCategory::rekurseCats (   $virtuemart_category_id,
  $level,
  $onlyPublished,
  $keyword,
$sortedCats,
  $deep = 0 
)
VirtueMartModelCategory::remove (   $cids)

Delete all categories selected

Author
jseros
Parameters
array$cidscategories to remove
Returns
boolean if the item remove was successful
VirtueMartModelCategory::setOrder (   $cats,
  $order 
)

Order category group

Author
jseros
Parameters
array$catscategories to order
Returns
bool
VirtueMartModelCategory::store ( $data)

Bind the post data to the category table and save it

Author
jseros, Max Milbers
Returns
int category id stored
VirtueMartModelCategory::toggle (   $field,
  $val = NULL,
  $cidname = 0,
  $tablename = 0,
  $view = false 
)

Member Data Documentation

VirtueMartModelCategory::$_category_tree
private
VirtueMartModelCategory::$_cleanCache = true
VirtueMartModelCategory::$_validOrderingFields = array('category_name','c.ordering,category_name','category_description','c.category_shared','c.published')
static
VirtueMartModelCategory::$categoryRecursed = 0
private

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