diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2009-05-12 04:41:41 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2009-05-12 04:41:41 +0400 |
commit | e3e058e101736ff4ab6b937f4dd919cc28f73e15 (patch) | |
tree | d8edf517633d7331709e33e27d5942f51ffd9dc5 | |
parent | 730571149b97e4117d9691b57cb2c3426b2e08c8 (diff) |
fixing bug in the datatable manager
-rw-r--r-- | core/DataTable/Manager.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/DataTable/Manager.php b/core/DataTable/Manager.php index 36bc3368e3..46564e1b48 100644 --- a/core/DataTable/Manager.php +++ b/core/DataTable/Manager.php @@ -42,23 +42,22 @@ class Piwik_DataTable_Manager protected $tables = array(); /** - * Id of the last inserted table in the Manager - * + * Id of the next inserted table id in the Manager * @var int */ - protected $lastTableid = 0; + protected $nextTableId = 0; /** * Add a DataTable to the registry * * @param Piwik_DataTable - * @return int Number of tables registered in the manager (including the one just added) + * @return int Index of the table in the manager array */ public function addTable( $table ) { - $this->tables[] = $table; - $this->lastTableId++; - return $this->lastTableId - 1; + $this->tables[$this->nextTableId] = $table; + $this->nextTableId++; + return $this->nextTableId - 1; } /** @@ -90,7 +89,7 @@ class Piwik_DataTable_Manager $this->deleteTable($id); } $this->tables = array(); - $this->lastTableId = 0; + $this->nextTableId = 0; } /** |