array[1045886960] = new Piwik_DataTable; * the nameKey would be 'timestamp'. * * This label is used in the Renderer (it becomes a column name or the XML description tag) * * @var string */ protected $nameKey = 'defaultKeyName'; /** * Returns the nameKey string @see self::$nameKey * * @return string */ public function getNameKey() { return $this->nameKey; } /** * Set the nameKey @see self::$nameKey * * @param string $name */ public function setNameKey($name) { $this->nameKey = $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 ) * * @return void */ 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. * * @return void */ public function applyQueuedFilters() { foreach($this->array as $table) { $table->applyQueuedFilters(); } } /** * 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( Piwik_DataTable $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($this); return (string)$renderer; } }