Open Journal Systems  2.4.8
 All Classes Namespaces Functions Variables Groups Pages
MetricsDAO Class Reference
Inheritance diagram for MetricsDAO:
DAO

Public Member Functions

 getLoadId ($assocType, $assocId, $metricType)
 
getMetrics ($metricType, $columns=array(), $filters=array(), $orderBy=array(), $range=null, $nonAdditive=true)
 
 hasRecord ($metricType)
 
 insertRecord (&$record, &$errorMsg)
 
 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 ()
 
 getDataChangedEvent ($elementId=null, $parentElementId=null)
 
getDataSource ()
 
 getDirectionMapping ($direction)
 
 getDriver ()
 
 getInsertId ($table= '', $id= '', $callHooks=true)
 
 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

- Public Attributes inherited from DAO
 $_dataSource
 

Detailed Description

Operations for retrieving and adding statistics data.

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

Member Function Documentation

MetricsDAO::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 201 of file MetricsDAO.inc.php.

References DAO\retrieve().

& MetricsDAO::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 False will mix two different metric types, results, which is conceptually wrong because different metric types counts events differently. Only use this in cases that you know the metric types counts events similary, and where the metric numbers accuracy is not that crucial.
Returns
null|array The selected data as a simple tabular result set or null if metrics are not supported by this plug-in, the specified report is invalid or cannot be produced or another error occurred.

Definition at line 44 of file MetricsDAO.inc.php.

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

MetricsDAO::hasRecord (   $metricType)

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

Parameters
$metricTypestring
Returns
boolean

Definition at line 220 of file MetricsDAO.inc.php.

References DAO\retrieve().

MetricsDAO::insertRecord ( $record,
$errorMsg 
)

Insert an entry into metrics table.

Parameters
$recordarray
$errorMsgstring

Definition at line 255 of file MetricsDAO.inc.php.

References DAORegistry\getDAO(), String\regexp_match(), and DAO\update().

MetricsDAO::purgeLoadBatch (   $loadId)

Purge a load batch before re-loading it.

Parameters
$loadIdstring

Definition at line 235 of file MetricsDAO.inc.php.

References DAO\update().

MetricsDAO::purgeRecords (   $metricType,
  $toDate 
)

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

Parameters
$metricTypestring
$toDatestring

Definition at line 245 of file MetricsDAO.inc.php.

References DAO\update().


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