Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
ViewsDAO Class Reference
Inheritance diagram for ViewsDAO:
DAO

Public Member Functions

 deleteViews ($assocType, $assocId)
 
 getLastViewDate ($assocType, $assocId, $userId=null)
 
 moveViews ($assocType, $oldAssocId, $newAssocId)
 
 recordView ($assocType, $assocId, $userId)
 
 ViewsDAO ()
 
- Public Member Functions inherited from DAO
 concat ()
 
 convertFromDB ($value, $type)
 
 convertToDB ($value, &$type)
 
 DAO ($dataSource=null, $callHooks=true)
 
 dateFromDB ($d)
 
 datetimeFromDB ($dt)
 
 datetimeToDB ($dt)
 
 dateToDB ($d)
 
 flushCache ()
 
 formatDateToDB ($date, $defaultNumWeeks=null, $acceptPastDate=true)
 
 getAffectedRows ()
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getType ($value)
 
 replace ($table, $arrFields, $keyCols)
 
retrieve ($sql, $params=false, $callHooks=true)
 
retrieveCached ($sql, $params=false, $secsToCache=3600, $callHooks=true)
 
retrieveLimit ($sql, $params=false, $numRows=false, $offset=false, $callHooks=true)
 
retrieveRange ($sql, $params=false, $dbResultRange=null, $callHooks=true)
 
 setCacheDir ()
 
 setDataSource (&$dataSource)
 
 update ($sql, $params=false, $callHooks=true, $dieOnError=true)
 
 updateDataObjectSettings ($tableName, &$dataObject, $idArray)
 

Additional Inherited Members

- Static Public Member Functions inherited from DAO
static getDataChangedEvent ($elementId=null, $parentElementId=null)
 
- Public Attributes inherited from DAO
 $_dataSource
 
- Protected Member Functions inherited from DAO
 _getInsertId ($table= '', $id= '')
 

Detailed Description

Class for keeping track of item views.

Definition at line 20 of file ViewsDAO.inc.php.

Member Function Documentation

ViewsDAO::deleteViews (   $assocType,
  $assocId 
)

Delete views of an assoc object.

Parameters
$assocTypeinteger One of the ASSOC_TYPE_* constants.
$assocIdstring

Definition at line 87 of file ViewsDAO.inc.php.

References DAO\update().

ViewsDAO::getLastViewDate (   $assocType,
  $assocId,
  $userId = null 
)

Get the timestamp of the last view.

Parameters
$assocTypeinteger
$assocIdstring
$userIdinteger
Returns
string|boolean Datetime of last view. False if no view found.

Definition at line 55 of file ViewsDAO.inc.php.

References DAO\retrieve().

ViewsDAO::moveViews (   $assocType,
  $oldAssocId,
  $newAssocId 
)

Move views from one assoc object to another.

Parameters
$assocTypeinteger One of the ASSOC_TYPE_* constants.
$oldAssocIdstring
$newAssocIdstring

Definition at line 75 of file ViewsDAO.inc.php.

References DAO\update().

ViewsDAO::recordView (   $assocType,
  $assocId,
  $userId 
)

Mark an item as viewed.

Parameters
$assocTypeinteger The associated type for the item being marked.
$assocIdstring The id of the object being marked.
$userIdinteger The id of the user viewing the item.
Returns
int RECORD_VIEW_RESULT_...

Definition at line 35 of file ViewsDAO.inc.php.

References DAO\replace().

ViewsDAO::ViewsDAO ( )

Constructor

Definition at line 24 of file ViewsDAO.inc.php.


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