Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Raue <christian.raue@gmail.com>2014-07-23 22:27:56 +0400
committerChristian Raue <christian.raue@gmail.com>2014-07-23 22:27:56 +0400
commitd9adcfe6169c6c10059a670f2ed984908eb4e105 (patch)
tree25cfca25851214c1b744a07e67e9c120adfd7513 /core/Archive.php
parent2788e1dad22533f3e0dbddbdd16c51251c4e130a (diff)
removed lots of trailing whitespace
Diffstat (limited to 'core/Archive.php')
-rw-r--r--core/Archive.php100
1 files changed, 50 insertions, 50 deletions
diff --git a/core/Archive.php b/core/Archive.php
index c7407c0af0..63f0a61dc8 100644
--- a/core/Archive.php
+++ b/core/Archive.php
@@ -16,49 +16,49 @@ use Piwik\Period\Factory;
/**
* The **Archive** class is used to query cached analytics statistics
* (termed "archive data").
- *
+ *
* You can use **Archive** instances to get data that was archived for one or more sites,
* for one or more periods and one optional segment.
- *
+ *
* If archive data is not found, this class will initiate the archiving process. [1](#footnote-1)
- *
+ *
* **Archive** instances must be created using the {@link build()} factory method;
* they cannot be constructed.
- *
+ *
* You can search for metrics (such as `nb_visits`) using the {@link getNumeric()} and
* {@link getDataTableFromNumeric()} methods. You can search for
* reports using the {@link getBlob()}, {@link getDataTable()} and {@link getDataTableExpanded()} methods.
- *
+ *
* If you're creating an API that returns report data, you may want to use the
* {@link getDataTableFromArchive()} helper function.
- *
+ *
* ### Learn more
- *
+ *
* Learn more about _archiving_ [here](/guides/all-about-analytics-data).
- *
+ *
* ### Limitations
- *
+ *
* - You cannot get data for multiple range periods in a single query.
* - You cannot get data for periods of different types in a single query.
- *
+ *
* ### Examples
- *
+ *
* **_Querying metrics for an API method_**
- *
+ *
* // one site and one period
* $archive = Archive::build($idSite = 1, $period = 'week', $date = '2013-03-08');
* return $archive->getDataTableFromNumeric(array('nb_visits', 'nb_actions'));
- *
+ *
* // all sites and multiple dates
* $archive = Archive::build($idSite = 'all', $period = 'month', $date = '2013-01-02,2013-03-08');
* return $archive->getDataTableFromNumeric(array('nb_visits', 'nb_actions'));
- *
+ *
* **_Querying and using metrics immediately_**
- *
+ *
* // one site and one period
* $archive = Archive::build($idSite = 1, $period = 'week', $date = '2013-03-08');
* $data = $archive->getNumeric(array('nb_visits', 'nb_actions'));
- *
+ *
* $visits = $data['nb_visits'];
* $actions = $data['nb_actions'];
*
@@ -67,37 +67,37 @@ use Piwik\Period\Factory;
* // multiple sites and multiple dates
* $archive = Archive::build($idSite = '1,2,3', $period = 'month', $date = '2013-01-02,2013-03-08');
* $data = $archive->getNumeric('nb_visits');
- *
+ *
* $janSite1Visits = $data['1']['2013-01-01,2013-01-31']['nb_visits'];
* $febSite1Visits = $data['1']['2013-02-01,2013-02-28']['nb_visits'];
* // ... etc.
- *
+ *
* **_Querying for reports_**
- *
+ *
* $archive = Archive::build($idSite = 1, $period = 'week', $date = '2013-03-08');
* $dataTable = $archive->getDataTable('MyPlugin_MyReport');
* // ... manipulate $dataTable ...
* return $dataTable;
- *
+ *
* **_Querying a report for an API method_**
- *
+ *
* public function getMyReport($idSite, $period, $date, $segment = false, $expanded = false)
* {
* $dataTable = Archive::getDataTableFromArchive('MyPlugin_MyReport', $idSite, $period, $date, $segment, $expanded);
* $dataTable->queueFilter('ReplaceColumnNames');
* return $dataTable;
* }
- *
+ *
* **_Querying data for multiple range periods_**
- *
+ *
* // get data for first range
* $archive = Archive::build($idSite = 1, $period = 'range', $date = '2013-03-08,2013-03-12');
* $dataTable = $archive->getDataTableFromNumeric(array('nb_visits', 'nb_actions'));
- *
+ *
* // get data for second range
* $archive = Archive::build($idSite = 1, $period = 'range', $date = '2013-03-15,2013-03-20');
* $dataTable = $archive->getDataTableFromNumeric(array('nb_visits', 'nb_actions'));
- *
+ *
* <a name="footnote-1"></a>
* [1]: The archiving process will not be launched if browser archiving is disabled
* and the current request came from a browser.
@@ -215,13 +215,13 @@ class Archive
/**
* Returns a new Archive instance that will query archive data for the given set of
* sites and periods, using an optional segment.
- *
+ *
* This method uses an array of Period instances and a Segment instance, instead of strings
* like {@link build()}.
- *
+ *
* If you want to create an Archive instance using data found in query parameters,
* use {@link build()}.
- *
+ *
* @param Segment $segment The segment to use. For no segment, use `new Segment('', $idSites)`.
* @param array $periods An array of Period instances.
* @param array $idSites An array of site IDs (eg, `array(1, 2, 3)`).
@@ -253,16 +253,16 @@ class Archive
/**
* Queries and returns metric data in an array.
- *
+ *
* If multiple sites were requested in {@link build()} or {@link factory()} the result will
* be indexed by site ID.
- *
+ *
* If multiple periods were requested in {@link build()} or {@link factory()} the result will
* be indexed by period.
- *
+ *
* The site ID index is always first, so if multiple sites & periods were requested, the result
* will be indexed by site ID first, then period.
- *
+ *
* @param string|array $names One or more archive names, eg, `'nb_visits'`, `'Referrers_distinctKeywords'`,
* etc.
* @return false|numeric|array `false` if there is no data to return, a single numeric value if we're not querying
@@ -289,17 +289,17 @@ class Archive
/**
* Queries and returns blob data in an array.
- *
+ *
* Reports are stored in blobs as serialized arrays of {@link DataTable\Row} instances, but this
* data can technically be anything. In other words, you can store whatever you want
* as archive data blobs.
*
* If multiple sites were requested in {@link build()} or {@link factory()} the result will
* be indexed by site ID.
- *
+ *
* If multiple periods were requested in {@link build()} or {@link factory()} the result will
* be indexed by period.
- *
+ *
* The site ID index is always first, so if multiple sites & periods were requested, the result
* will be indexed by site ID first, then period.
*
@@ -317,20 +317,20 @@ class Archive
/**
* Queries and returns metric data in a DataTable instance.
- *
+ *
* If multiple sites were requested in {@link build()} or {@link factory()} the result will
* be a DataTable\Map that is indexed by site ID.
- *
+ *
* If multiple periods were requested in {@link build()} or {@link factory()} the result will
* be a {@link DataTable\Map} that is indexed by period.
- *
+ *
* The site ID index is always first, so if multiple sites & periods were requested, the result
* will be a {@link DataTable\Map} indexed by site ID which contains {@link DataTable\Map} instances that are
* indexed by period.
- *
+ *
* _Note: Every DataTable instance returned will have at most one row in it. The contents of each
* row will be the requested metrics for the appropriate site and period._
- *
+ *
* @param string|array $names One or more archive names, eg, 'nb_visits', 'Referrers_distinctKeywords',
* etc.
* @return DataTable|DataTable\Map A DataTable if multiple sites and periods were not requested.
@@ -344,20 +344,20 @@ class Archive
/**
* Queries and returns one or more reports as DataTable instances.
- *
+ *
* This method will query blob data that is a serialized array of of {@link DataTable\Row}'s and
* unserialize it.
- *
+ *
* If multiple sites were requested in {@link build()} or {@link factory()} the result will
* be a {@link DataTable\Map} that is indexed by site ID.
- *
+ *
* If multiple periods were requested in {@link build()} or {@link factory()} the result will
* be a DataTable\Map that is indexed by period.
- *
+ *
* The site ID index is always first, so if multiple sites & periods were requested, the result
* will be a {@link DataTable\Map} indexed by site ID which contains {@link DataTable\Map} instances that are
* indexed by period.
- *
+ *
* @param string $name The name of the record to get. This method can only query one record at a time.
* @param int|string|null $idSubtable The ID of the subtable to get (if any).
* @return DataTable|DataTable\Map A DataTable if multiple sites and periods were not requested.
@@ -371,13 +371,13 @@ class Archive
/**
* Queries and returns one report with all of its subtables loaded.
- *
+ *
* If multiple sites were requested in {@link build()} or {@link factory()} the result will
* be a DataTable\Map that is indexed by site ID.
- *
+ *
* If multiple periods were requested in {@link build()} or {@link factory()} the result will
* be a DataTable\Map that is indexed by period.
- *
+ *
* The site ID index is always first, so if multiple sites & periods were requested, the result
* will be a {@link DataTable\Map indexed} by site ID which contains {@link DataTable\Map} instances that are
* indexed by period.
@@ -399,7 +399,7 @@ class Archive
/**
* Returns the list of plugins that archive the given reports.
- *
+ *
* @param array $archiveNames
* @return array
*/
@@ -426,7 +426,7 @@ class Archive
/**
* Helper function that creates an Archive instance and queries for report data using
* query parameter data. API methods can use this method to reduce code redundancy.
- *
+ *
* @param string $name The name of the report to return.
* @param int|string|array $idSite @see {@link build()}
* @param string $period @see {@link build()}