UNA
Loading...
Searching...
No Matches
BxDolFavorite Class Reference
Inheritance diagram for BxDolFavorite:
BxDolObject BxDolFactory iBxDolReplaceable BxBaseFavorite BxTemplFavorite BxOrgsFavorite BxPersonsFavorite

Public Member Functions

 getConditionsTrack ($sMainTable, $sMainField, $iAuthorId=0, $iListId=0)
 
 actionFavorite ()
 
 actionEditList ()
 
 actionDeleteList ()
 
 actionGetFavoritedBy ()
 
 isAllowedFavorite ($isPerformAction=false)
 
 isAllowedEditList ($iAuthorId, $isPerformAction=false)
 
 msgErrAllowedFavorite ()
 
 isAllowedFavoriteView ($isPerformAction=false)
 
 msgErrAllowedFavoriteView ()
 
 isUndo ()
 
 isPublic ()
 
- Public Member Functions inherited from BxDolObject
 init ($iId)
 
 getSystemId ()
 
 getSystemName ()
 
 getSystemInfo ()
 
 getId ()
 
 setId ($iId)
 
 isEnabled ()
 
 isPerformed ($iObjectId, $iAuthorId, $iAuthorIp=0)
 
 getVote ($iObjectId=0, $bForceGet=false)
 
 getTrack ($iObjectId, $iAuthorId)
 
 getConditions ($sMainTable, $sMainField)
 
 getConditionsTrack ($sMainTable, $sMainField, $iAuthorId=0)
 
 getSqlParts ($sMainTable, $sMainField)
 
 getSqlPartsTrack ($sMainTable, $sMainField, $iAuthorId=0)
 
 getSqlPartsTrackAuthor ($sMainTable, $sMainField, $iObjectId=0)
 
 addMarkers ($aMarkers)
 
 getElementAPI ($aParams=[])
 
 getCounterAPI ($aParams=[])
 
 getQueryObject ()
 
 checkAction ($sAction, $isPerformAction=false)
 
 checkActionErrorMsg ($sAction)
 
 onObjectDelete ($iObjectId=0)
 

Static Public Member Functions

static getObjectInstance ($sSys, $iId, $iInit=true)
 
static & getSystems ()
 
static onAuthorDelete ($iAuthorId)
 
- Static Public Member Functions inherited from BxDolObject
static pruning ()
 

Protected Member Functions

 __construct ($sSystem, $iId, $iInit=true, $oTemplate=false)
 
 _getIconDoFavorite ($bPerformed)
 
 _getTitleDoFavorite ($bPerformed)
 
 _getFormObject ($sDisplayName)
 
- Protected Member Functions inherited from BxDolObject
 _getAuthorId ()
 
 _getAuthorPassword ()
 
 _getAuthorIp ()
 
 _getAuthorInfo ($iAuthorId=0)
 
 _getAuthorObject ($iAuthorId=0)
 
 _trigger ()
 
 _triggerValue ($iValue)
 
 _replaceMarkers ($mixed)
 
 _prepareParamsData ($aParams)
 
 _getRequestParamsData ($aKeys=array())
 
 _prepareRequestParamsData ($aParams, $aParamsAdd=array())
 
 _getTmplContentElementBlock ()
 
 _getTmplContentElementInline ()
 
 _getTmplContentDoAction ()
 
 _getTmplContentDoActionLabel ()
 
 _getTmplContentCounter ()
 
 _getTmplContentCounterLabel ()
 

Protected Attributes

 $_sBaseUrl
 
 $_sFormObject
 
 $_sFormDisplayAdd
 
 $_sFormDisplayListEdit
 
- Protected Attributes inherited from BxDolObject
 $_oTemplate = null
 
 $_oQuery = null
 
 $_bApi = false
 
 $_iId = 0
 
 $_sSystem = ''
 
 $_aSystem = array()
 
 $_aMarkers = array ()
 
 $_sTmplContentElementBlock = ''
 
 $_sTmplContentElementInline = ''
 
 $_sTmplContentDoAction
 
 $_sTmplContentDoActionLabel = ''
 
 $_sTmplContentCounter = ''
 
 $_sTmplContentCounterLabel = ''
 

Detailed Description

Track any object favorites automatically

Add record to sys_object_favorite table to track object favorites, to record favorites just create this class instance with your object id, for example:

BxDolFavorite::getObjectInstance('my_system', 25); // 25 - is object id
static getObjectInstance($sSys, $iId, $iInit=true)
Definition BxDolFavorite.php:80

Description of sys_object_favorite 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 favorites
`table_lists` - table with lists
`is_on` - is the system activated
`trigger_table` - table where you need to update favorites field
`trigger_field_id` - table field id to unique determine object
`trigger_field_count` - table field where total favorites 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_favorites_track` (
`object_id` int(11) NOT NULL default '0', -- this field type must be exact as your object id type
`author_id` int(11) NOT NULL default '0', -- favoring user profile id
`date` int(11) NOT NULL default '0', -- timestamp of last recorded view
KEY `id` (`object_id`,`author_id`)
);

Constructor & Destructor Documentation

◆ __construct()

BxDolFavorite::__construct ( $sSystem,
$iId,
$iInit = true,
$oTemplate = false )
protected

Reimplemented from BxDolObject.

Member Function Documentation

◆ _getIconDoFavorite()

BxDolFavorite::_getIconDoFavorite ( $bPerformed)
protected

Internal functions

◆ actionFavorite()

BxDolFavorite::actionFavorite ( )

Actions functions

◆ getObjectInstance()

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

get favorites object instanse

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

◆ getSystems()

static & BxDolFavorite::getSystems ( )
static

Reimplemented from BxDolObject.

◆ isAllowedFavorite()

BxDolFavorite::isAllowedFavorite ( $isPerformAction = false)

Permissions functions

Reimplemented in BxOrgsFavorite, and BxPersonsFavorite.

◆ isUndo()

BxDolFavorite::isUndo ( )

Auxiliary functions


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