UNA
BxDolView Class Reference
Inheritance diagram for BxDolView:
BxDolObject BxDolFactory iBxDolReplaceable BxBaseView BxTemplView

Public Member Functions

 isAllowedView ($isPerformAction=false)
 
- Public Member Functions inherited from BxDolObject
 getConditions ($sMainTable, $sMainField)
 
 getQueryObject ()
 
 checkAction ($sAction, $isPerformAction=false)
 
 onObjectDelete ($iObjectId=0)
 

Static Public Member Functions

static getObjectInstance ($sSys, $iId, $iInit=true)
 

Protected Member Functions

 _getIconDo ()
 
- Protected Member Functions inherited from BxDolObject
 _getAuthorId ()
 
 _trigger ()
 
 _triggerValue ($iValue)
 
 _replaceMarkers ($mixed)
 

Detailed Description

Track any object views automatically

Add record to sys_object_view table to track object views, to record view just create this class instance with your object id, for example:

BxDolView::getObjectInstance('my_system', 25); // 25 - is object id

Description of sys_object_view table fields:

`name` - system name, it is better to use unique module prefix here, lowercase and all spaces are underscored
`table_track` - table to track views
`period` - period in secs to update next views, default is 86400(1 day)
`is_on` - is the system activated
`trigger_table` - table where you need to update views field
`trigger_field_id` - table field id to unique determine object
`trigger_field_count` - table field where total view number is stored
`class_name` - your custom class name, if you overrride default class
`class_file` - your custom class path

Structure of the track table is the following:

CREATE TABLE `my_views_track` (
`object_id` int(11) NOT NULL default '0', -- this field type must be exact as your object id type
`viewer_id` int(11) NOT NULL default '0', -- viewer profile id
`viewer_nip` int(11) unsigned NOT NULL default '0', -- viewer ip address to track guest views
`date` int(11) NOT NULL default '0', -- timestamp of last recorded view
KEY `id` (`object_id`,`viewer_id`,`viewer_nip`)
);

Member Function Documentation

◆ _getIconDo()

BxDolView::_getIconDo ( )
protected

Internal functions

◆ getObjectInstance()

static BxDolView::getObjectInstance (   $sSys,
  $iId,
  $iInit = true 
)
static

get votes object instanse

Parameters
$sSysview object name
$iIdassociated content id, where vote is available
$iInitperform initialization
Returns
null on error, or ready to use class instance

◆ isAllowedView()

BxDolView::isAllowedView (   $isPerformAction = false)

Permissions functions

Note. The 'view' action is performed automatically and therefore the manual action is not allowed.


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