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

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
 $_dataSource
 

Detailed Description

Class with basic operations for retrieving and adding statistics data.

Definition at line 19 of file PKPMetricsDAO.inc.php.

Member Function Documentation

PKPMetricsDAO::foreignKeyLookup (   $assocType,
  $assocId 
)
protected

Foreign key lookup for the published object dimension.

Parameters
$assocTypeint
$assocIdint
Returns
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 PKPMetricsDAO.inc.php.

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

Referenced by insertRecord().

PKPMetricsDAO::getLoadId (   $assocType,
  $assocId,
  $metricType 
)

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

Parameters
$assocTypeint
$assocIdint
$metricTypestring
Returns
array

Definition at line 212 of file PKPMetricsDAO.inc.php.

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
http://pkp.sfu.ca/wiki/index.php/OJSdeStatisticsConcept#Input_and_Output_Formats_.28Aggregation.2C_Filters.2C_Metrics_Data.29 for a full specification of the input and output format of this method.
Parameters
$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.
Returns
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 PKPMetricsDAO.inc.php.

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

PKPMetricsDAO::hasRecord (   $metricType)

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

Parameters
$metricTypestring
Returns
boolean

Definition at line 231 of file PKPMetricsDAO.inc.php.

References DAO\retrieve().

PKPMetricsDAO::insertRecord (   $record)

Insert an entry into metrics table.

Parameters
$recordarray
$errorMsgstring

Definition at line 266 of file PKPMetricsDAO.inc.php.

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

PKPMetricsDAO::purgeLoadBatch (   $loadId)

Purge a load batch.

Parameters
$loadIdstring

Definition at line 246 of file PKPMetricsDAO.inc.php.

References DAO\update().

PKPMetricsDAO::purgeRecords (   $metricType,
  $toDate 
)

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

Parameters
$metricTypestring
$toDatestring

Definition at line 256 of file PKPMetricsDAO.inc.php.

References DAO\update().


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