Documentation

Vote_Controller
in package

Votes.

Tags
subpackage

Vote

version
7.x
author

Hostmake LLC

copyright

© 2005-2024 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

Table of Contents

Properties

$instance  : mixed
The singleton instances.
$_allowedTypes  : array<string|int, mixed>
List of allowed object for comment

Methods

getRate()  : array<string|int, mixed>
Getting rate by type and object ID
getRateByObject()  : array<string|int, mixed>
Getting rate by object
getVotedObject()  : null|Core_Entity
Getting voted object by type
instance()  : object
Register an existing instance as a singleton.

Properties

$instance

The singleton instances.

public static mixed $instance = \NULL

$_allowedTypes

List of allowed object for comment

protected array<string|int, mixed> $_allowedTypes = array('comment', 'informationsystem_item', 'shop_item')

Methods

getRate()

Getting rate by type and object ID

public getRate(string $type, int $id) : array<string|int, mixed>
Parameters
$type : string

type name of voted object, e.g. 'comment'

$id : int

object ID

Return values
array<string|int, mixed>

'likes', 'dislikes', 'rate'

getRateByObject()

Getting rate by object

public getRateByObject(Core_Entity $oObject) : array<string|int, mixed>
Parameters
$oObject : Core_Entity
Return values
array<string|int, mixed>

'likes', 'dislikes', 'rate'

getVotedObject()

Getting voted object by type

public getVotedObject(string $type, int $id) : null|Core_Entity
Parameters
$type : string

type name of voted object, e.g. 'comment'

$id : int

object ID

Return values
null|Core_Entity

instance()

Register an existing instance as a singleton.

public static instance() : object
Return values
object

        
On this page

Search results