Skip to content
Extraits de code Groupes Projets
Valider 6afd88e6 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Refs #4200, documented core/DataTable/Simple.php.

parent 055eaa81
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -16,35 +16,28 @@ use Piwik\DataTable; ...@@ -16,35 +16,28 @@ use Piwik\DataTable;
* A [DataTable](#) where every row has two columns: **label** and **value**. * A [DataTable](#) where every row has two columns: **label** and **value**.
* *
* Simple DataTables are only used to slightly alter the output of some renderers * Simple DataTables are only used to slightly alter the output of some renderers
* (namely the XML renderer). * (notably the XML renderer).
* *
* @package Piwik * @package Piwik
* @subpackage DataTable * @subpackage DataTable
* @api
*/ */
class Simple extends DataTable class Simple extends DataTable
{ {
/** /**
* Adds in the DataTable the array information * Adds rows based on an array mapping label column values to value column
* values.
* *
* @param array $array Array containing the rows information * @param array $array Array containing the rows, eg,
* array( * ```
* 'Label row 1' => $value1, * array(
* 'Label row 2' => $value2, * 'Label row 1' => $value1,
* ) * 'Label row 2' => $value2,
* )
* ```
*/ */
public function addRowsFromArray($array) public function addRowsFromArray($array)
{ {
$this->addRowsFromSimpleArray(array($array)); $this->addRowsFromSimpleArray(array($array));
} }
/**
* Updates the given column with the given value
*
* @param string $columnName
* @param mixed $value
*/
public function setColumn($columnName, $value)
{
$this->getLastRow()->setColumn($columnName, $value);
}
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter