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

Public Member Functions

 getLoadId ($assocType, $assocId, $metricType)
getMetrics ($metricType, $columns=array(), $filters=array(), $orderBy=array(), $range=null, $nonAdditive=true)
 hasRecord ($metricType)
 insertRecord ($record)
 purgeLoadBatch ($loadId)
 purgeRecords ($metricType, $toDate)
- 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)

Protected Member Functions

 foreignKeyLookup ($assocType, $assocId)
- Protected Member Functions inherited from DAO
 _getInsertId ($table= '', $id= '')

Additional Inherited Members

- Static Public Member Functions inherited from DAO
static getDataChangedEvent ($elementId=null, $parentElementId=null)
- Public Attributes inherited from DAO

Detailed Description

Class with basic operations for retrieving and adding statistics data.

Definition at line 19 of file

Member Function Documentation

PKPMetricsDAO::foreignKeyLookup (   $assocType,

Foreign key lookup for the published object dimension.

array Values must be foreign keys relative to the context, pkp section, associated object (type and id), submission and representation.

Definition at line 345 of file

References Application\getContextAssocType(), Application\getContextDAO(), DAORegistry\getDAO(), Application\getRepresentationDAO(), Application\getSectionDAO(), and Application\getSubmissionDAO().

Referenced by insertRecord().

PKPMetricsDAO::getLoadId (   $assocType,

Get all load ids that are associated with records filtered by the passed arguments.


Definition at line 212 of file

References DAO\retrieve().

& PKPMetricsDAO::getMetrics (   $metricType,
  $columns = array(),
  $filters = array(),
  $orderBy = array(),
  $range = null,
  $nonAdditive = true 

Retrieve a range of aggregate, filtered, ordered metric values, i.e. a statistics report.

See Also for a full specification of the input and output format of this method.
$metricTypestring|array metrics selection
$columnsstring|array column (aggregation level) selection
$filtersarray report-level filter selection
$orderByarray order criteria
$rangenull|DBResultRange paging specification
$nonAdditiveboolean (optional) Whether the metric type dimension will be additive or not. This must be used with care, different metric types should not be additive because they may diverge in ways of counting usage events.
null|array The selected data as a simple tabular result set or null if metrics are not supported, the specified report is invalid or cannot be produced or another error occurred.

Definition at line 41 of file

References DAO\retrieveLimit(), and DAO\retrieveRange().

PKPMetricsDAO::hasRecord (   $metricType)

Check for the presence of any record that has the passed metric type.


Definition at line 231 of file

References DAO\retrieve().

PKPMetricsDAO::insertRecord (   $record)

Insert an entry into metrics table.


Definition at line 266 of file

References foreignKeyLookup(), String\regexp_match(), and DAO\update().

PKPMetricsDAO::purgeLoadBatch (   $loadId)

Purge a load batch.


Definition at line 246 of file

References DAO\update().

PKPMetricsDAO::purgeRecords (   $metricType,

Purge all records associated with the passed metric type until the passed date.


Definition at line 256 of file

References DAO\update().

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