tables[] = $table; return count($this->tables); } /** * Returns the DataTable associated to the ID $idTable. * NB: The datatable has to have been instanciated before! * This method will not fetch the DataTable from the DB. * * @exception If the table can't be found * @return Piwik_DataTable The table */ public function getTable( $idTable ) { // the array tables is indexed at 0 // but the index is computed as the count() of the array after inserting the table $idTable -= 1; if(!isset($this->tables[$idTable])) { throw new Exception("The request table $idTable couldn't be found."); } return $this->tables[$idTable]; } /** * Returns all the dataTable registered in the manager * * @return array of Piwik_DataTable */ public function getTables() { return $this->tables; } /** * Delete all the registered DataTables from the manager * * @return void */ public function deleteAll() { $this->tables = array(); } /** * Returns the number of DataTable currently registered. * * @return int */ public function count() { return count($this->tables); } }