array[1045886960] = new Piwik_DataTable(); * the keyName would be 'timestamp'. * * This label is used in the Renderer (it becomes a column name or the XML description tag) * * @var string */ protected $keyName = 'defaultKeyName'; /** * Returns the keyName string @see self::$keyName * * @return string */ public function getKeyName() { return $this->keyName; } /** * Set the keyName @see self::$keyName * * @param string $name */ public function setKeyName($name) { $this->keyName = $name; } /** * Returns the number of DataTable in this DataTable_Array * * @return int */ public function getRowsCount() { return count($this->array); } /** * Queue a filter to the DataTable_Array will queue this filter to every DataTable of the DataTable_Array. * * @param string $className Filter name, eg. Piwik_DataTable_Filter_Limit * @param array $parameters Filter parameters, eg. array( 50, 10 ) */ public function queueFilter( $className, $parameters = array() ) { foreach($this->array as $table) { $table->queueFilter($className, $parameters); } } /** * Apply the filters previously queued to each of the DataTable of this DataTable_Array. */ public function applyQueuedFilters() { foreach($this->array as $table) { $table->applyQueuedFilters(); } } /** * Apply a filter to all tables in the array * @param $className * @param $parameters */ public function filter($className, $parameters = array()) { foreach($this->array as $id => $table) { $table->filter($className, $parameters); } } /** * Returns the array of DataTable * * @return array of Piwik_DataTable */ public function getArray() { return $this->array; } /** * Adds a new DataTable to the DataTable_Array * * @param Piwik_DataTable $table * @param string $label Label used to index this table in the array */ public function addTable( $table, $label ) { $this->array[$label] = $table; } /** * Returns a string output of this DataTable_Array (applying the default renderer to every DataTable * of this DataTable_Array). * * @return string */ public function __toString() { $renderer = new Piwik_DataTable_Renderer_Console(); $renderer->setTable($this); return (string)$renderer; } /** * @see Piwik_DataTable::enableRecursiveSort() */ public function enableRecursiveSort() { foreach($this->array as $table) { $table->enableRecursiveSort(); } } public function deleteColumns($columns) { foreach($this->array as $table) { $table->deleteColumns($columns); } } }