Filter
1 month ago
Renderer
2 weeks ago
Row
1 month ago
BaseFilter.php
1 month ago
Bridges.php
2 years ago
DataTableInterface.php
6 months ago
Manager.php
2 years ago
Map.php
1 month ago
Renderer.php
1 month ago
Row.php
1 month ago
Simple.php
2 years ago
TableNotFoundException.php
2 years ago
Simple.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | */ |
| 9 | namespace Piwik\DataTable; |
| 10 | |
| 11 | use Piwik\DataTable; |
| 12 | /** |
| 13 | * A {@link Piwik\DataTable} where every row has two columns: **label** and **value**. |
| 14 | * |
| 15 | * Simple DataTables are only used to slightly alter the output of some renderers |
| 16 | * (notably the XML renderer). |
| 17 | * |
| 18 | * @api |
| 19 | */ |
| 20 | class Simple extends DataTable |
| 21 | { |
| 22 | /** |
| 23 | * Adds rows based on an array mapping label column values to value column |
| 24 | * values. |
| 25 | * |
| 26 | * @param array $array Array containing the rows, eg, |
| 27 | * |
| 28 | * array( |
| 29 | * 'Label row 1' => $value1, |
| 30 | * 'Label row 2' => $value2, |
| 31 | * ) |
| 32 | */ |
| 33 | public function addRowsFromArray($array) |
| 34 | { |
| 35 | $this->addRowsFromSimpleArray(array($array)); |
| 36 | } |
| 37 | } |
| 38 |