Skip to content
Extraits de code Groupes Projets
DataTable.php 27,3 ko
Newer Older
  • Learn to ignore specific revisions
  • 		foreach($array as $label => $row)
    		{
    			// we make sure that the label column is first in the list! 
    			// important for the UI javascript mainly...
    			// array_merge doesn't work here as it reindex the numeric value
    			// see the test testMergeArray in PHP_Related.test.php
    			$cleanRow[Piwik_DataTable_Row::COLUMNS] = array('label' => $label) + $row;
    			if(!is_null($subtablePerLabel)
    				// some rows of this table don't have subtables 
    				// (for examplecase of the campaign without keywords )
    				&& isset($subtablePerLabel[$label]) 
    			)
    			{
    				$cleanRow[Piwik_DataTable_Row::DATATABLE_ASSOCIATED] = $subtablePerLabel[$label];
    			}
    			$this->addRow( new Piwik_DataTable_Row($cleanRow) );
    		}
    	}
    
    	/**
    	 * At destruction we try to free memory
    	 * But php doesn't give us much control on this
    	 */
    	public function __destruct()
    	{
    		unset($this->rows);
    	}
    	
    }