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

Public Member Functions

 __construct ()
 
 getRatings ()
 
 getRating ($cids)
 
 getReviews ($virtuemart_product_id, $virtuemart_vendor_id=0, $num_reviews=false)
 
 getReview ($cids, $new=false)
 
 getRatingByProduct ($product_id, $onlyPublished=true)
 
 getProductReviewForUser ($product_id, $userId=0)
 
 getReviewByProduct ($product_id, $userId=0)
 
 getReviewsByProduct ($product_id)
 
 getVoteByProduct ($product_id, $userId=0)
 
 getAverageVotesByProductId ($prId)
 
 getVoteById ($id)
 
 saveRating ($data=0)
 
 remove ($ids)
 
 countReviewsForProduct ($pid)
 
 showReview ($product_id)
 
 showRating ($product_id=0)
 
 allowReview ($product_id)
 
 allowRating ($product_id)
 
- 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 getSelect ()
 
- 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

 $_productBought = array()
 
- 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')
 

Private Member Functions

 show ($product_id, $show)
 

Static Private Attributes

static $_select = TRUE
 
static $_jTables
 

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
 

Constructor & Destructor Documentation

VirtueMartModelRatings::__construct ( )

constructs a VmModel setMainTable defines the maintable of the model

Author
Max Milbers

Member Function Documentation

VirtueMartModelRatings::allowRating (   $product_id)
VirtueMartModelRatings::allowReview (   $product_id)
VirtueMartModelRatings::countReviewsForProduct (   $pid)

Returns the number of reviews assigned to a product

Author
RolandD
Parameters
int$pidProduct ID
Returns
int
VirtueMartModelRatings::getAverageVotesByProductId (   $prId)
VirtueMartModelRatings::getProductReviewForUser (   $product_id,
  $userId = 0 
)

gets a review by a product id

Author
Max Milbers
Parameters
int$product_id
VirtueMartModelRatings::getRating (   $cids)

Load a single rating

Author
RolandD
VirtueMartModelRatings::getRatingByProduct (   $product_id,
  $onlyPublished = true 
)

gets a rating by a product id

Author
Max Milbers
Parameters
int$product_id
VirtueMartModelRatings::getRatings ( )

Select the products to list on the product list page

VirtueMartModelRatings::getReview (   $cids,
  $new = false 
)
Author
Max Milbers
Parameters
$cids
Returns
mixed@
VirtueMartModelRatings::getReviewByProduct (   $product_id,
  $userId = 0 
)
VirtueMartModelRatings::getReviews (   $virtuemart_product_id,
  $virtuemart_vendor_id = 0,
  $num_reviews = false 
)
Author
Max Milbers
Parameters
$virtuemart_product_id
Returns
null
VirtueMartModelRatings::getReviewsByProduct (   $product_id)

gets a reviews by a product id

Author
Max Milbers
Parameters
int$product_id
static VirtueMartModelRatings::getSelect ( )
static
VirtueMartModelRatings::getVoteById (   $id)
VirtueMartModelRatings::getVoteByProduct (   $product_id,
  $userId = 0 
)

gets a vote by a product id and userId

Author
Max Milbers
Parameters
int$product_id
VirtueMartModelRatings::remove (   $ids)

removes a product and related table entries

Author
Max Milberes
VirtueMartModelRatings::saveRating (   $data = 0)

Save a rating

Author
Max Milbers
VirtueMartModelRatings::show (   $product_id,
  $show 
)
private

Decides if the rating/review should be shown on the FE

Author
Max Milbers
VirtueMartModelRatings::showRating (   $product_id = 0)
VirtueMartModelRatings::showReview (   $product_id)

Member Data Documentation

VirtueMartModelRatings::$_jTables
staticprivate
Initial value:
= ' LEFT JOIN `#__virtuemart_rating_votes` AS `rv` on
(`pr`.`virtuemart_rating_vote_id` IS NOT NULL AND `rv`.`virtuemart_rating_vote_id`=`pr`.`virtuemart_rating_vote_id` ) XOR
(`pr`.`virtuemart_rating_vote_id` IS NULL AND (`rv`.`virtuemart_product_id`=`pr`.`virtuemart_product_id` and `rv`.`created_by`=`pr`.`created_by`) )
LEFT JOIN `#__users` AS `u` ON `pr`.`created_by` = `u`.`id` '
VirtueMartModelRatings::$_productBought = array()
VirtueMartModelRatings::$_select = TRUE
staticprivate

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