Exemplo n.º 1
0
 public function __construct($table, $detailName, $detailValue)
 {
     parent::__construct($table);
     $this->name = $detailName;
     $this->value = $detailValue;
     $this->filter();
 }
 public function __construct($table, $startRowToSummarize, $labelSummaryRow = Piwik_DataTable::LABEL_SUMMARY_ROW, $columnToSortByBeforeTruncating = null)
 {
     parent::__construct($table);
     $this->startRowToSummarize = $startRowToSummarize;
     $this->labelSummaryRow = $labelSummaryRow;
     $this->columnToSortByBeforeTruncating = $columnToSortByBeforeTruncating;
 }
 public function __construct($table, $columnToFilter, $functionToApply, $functionParameters = null)
 {
     parent::__construct($table);
     $this->functionToApply = $functionToApply;
     $this->functionParameters = $functionParameters;
     $this->columnToFilter = $columnToFilter;
 }
Exemplo n.º 4
0
 public function __construct($table, $columnToFilter, $patternToSearch)
 {
     parent::__construct($table);
     $this->patternToSearch = $patternToSearch;
     $this->columnToFilter = $columnToFilter;
     $this->filter();
 }
Exemplo n.º 5
0
 public function __construct($table, $columnToFilter, $minimumValue)
 {
     $this->columnToFilter = $columnToFilter;
     self::$minimumValue = $minimumValue;
     parent::__construct($table);
     $this->filter();
 }
Exemplo n.º 6
0
 /**
  * Constructor.
  * 
  * @param Piwik_DataTable  $table           The DataTable to filter.
  * @param string           $groupByColumn   The column name to reduce.
  * @param mixed            $reduceFunction  The reduce function. This must alter the $groupByColumn in some way.
  * @param array            $parameters      Extra parameters to supply to the reduce function.
  */
 public function __construct($table, $groupByColumn, $reduceFunction, $parameters = array())
 {
     parent::__construct($table);
     $this->groupByColumn = $groupByColumn;
     $this->reduceFunction = $reduceFunction;
     $this->parameters = $parameters;
 }
Exemplo n.º 7
0
 public function __construct($table, $columnToFilter, $functionToApply)
 {
     parent::__construct($table);
     $this->functionToApply = $functionToApply;
     $this->columnToFilter = $columnToFilter;
     $this->filter();
 }
	/**
	 * @param $table
	 * @param $enable Automatically set to true when filter_update_columns_when_show_all_goals is found in the API request
	 * @param $processOnlyIdGoal
	 * @return unknown_type
	 */
	public function __construct( $table, $enable = true, $processOnlyIdGoal )
	{
		parent::__construct($table);
		$this->mappingIdToNameGoal = Piwik_Archive::$mappingFromIdToNameGoal;
		$this->processOnlyIdGoal = $processOnlyIdGoal;
		$this->filter();
	}
Exemplo n.º 9
0
 public function __construct($table, $metadataName, $metadataValue)
 {
     parent::__construct($table);
     $this->name = $metadataName;
     $this->value = $metadataValue;
     $this->filter();
 }
 /**
  * @param Piwik_DataTable  $table
  * @param string           $metadataToRead
  * @param string           $metadataToAdd
  * @param callback         $functionToApply
  */
 public function __construct($table, $metadataToRead, $metadataToAdd, $functionToApply)
 {
     parent::__construct($table);
     $this->functionToApply = $functionToApply;
     $this->metadataToRead = $metadataToRead;
     $this->metadataToAdd = $metadataToAdd;
 }
Exemplo n.º 11
0
	public function __construct( $table, $columnToFilter, $patternToSearch, $invertedMatch = false )
	{
		parent::__construct($table);
		$this->patternToSearch = $patternToSearch;
		$this->patternToSearchQuoted = self::getPatternQuoted($patternToSearch);
		$this->columnToFilter = $columnToFilter;
        $this->invertedMatch = $invertedMatch;
	}
Exemplo n.º 12
0
 /**
  * @param DataTable Table
  * @param array Mapping to apply. Must have the format 	
  * 				array( 	OLD_COLUMN_NAME => NEW_COLUMN NAME,
  * 						OLD_COLUMN_NAME2 => NEW_COLUMN NAME2,
  * 					)
  */
 public function __construct($table, $mappingToApply = null)
 {
     parent::__construct($table);
     $this->mappingToApply = Piwik_Archive::$mappingFromIdToName;
     if (!is_null($mappingToApply)) {
         $this->mappingToApply = $mappingToApply;
     }
 }
Exemplo n.º 13
0
 /**
  * @param DataTable Table
  * @param array Mapping to apply. Must have the format 	
  * 				array( 	OLD_COLUMN_NAME => NEW_COLUMN NAME,
  * 						OLD_COLUMN_NAME2 => NEW_COLUMN NAME2,
  * 					)
  */
 public function __construct($table, $mappingToApply = null)
 {
     parent::__construct($table);
     if (!is_null($mappingToApply)) {
         $this->mappingToApply = $mappingToApply;
     }
     $this->filter();
 }
 public function __construct($table, $columnToRead, $metadataToAdd, $functionToApply = null, $functionParameters = null)
 {
     parent::__construct($table);
     $this->functionToApply = $functionToApply;
     $this->functionParameters = $functionParameters;
     $this->columnToRead = $columnToRead;
     $this->metadataToAdd = $metadataToAdd;
 }
Exemplo n.º 15
0
 /**
  * @param Piwik_DataTable  $table
  * @param string|null      $newLabel  new label for summary row
  */
 public function __construct($table, $newLabel = null)
 {
     parent::__construct($table);
     if (is_null($newLabel)) {
         $newLabel = Piwik_Translate('General_Others');
     }
     $this->newLabel = $newLabel;
 }
Exemplo n.º 16
0
 public function __construct($table, $startRowToSummarize)
 {
     parent::__construct($table);
     $this->startRowToSummarize = $startRowToSummarize;
     if ($table->getRowsCount() > $startRowToSummarize + 1) {
         $this->filter();
     }
 }
Exemplo n.º 17
0
 public function __construct($table, $columnToRead, $detailToAdd, $functionToApply)
 {
     parent::__construct($table);
     $this->functionToApply = $functionToApply;
     $this->columnToRead = $columnToRead;
     $this->detailToAdd = $detailToAdd;
     $this->filter();
 }
Exemplo n.º 18
0
	public function __construct( $table, $columnToFilter, $patternToSearch )
	{
		parent::__construct($table);
		$this->patternToSearch = $patternToSearch;
		$this->patternToSearchQuoted = Piwik_DataTable_Filter_Pattern::getPatternQuoted($patternToSearch);
		$this->patternToSearch = $patternToSearch;//preg_quote($patternToSearch);
		$this->columnToFilter = $columnToFilter;
	}
Exemplo n.º 19
0
 public function __construct($table, $columnToFilter, $patternToSearch)
 {
     parent::__construct($table);
     $this->patternToSearch = $patternToSearch;
     //preg_quote($patternToSearch);
     $this->columnToFilter = $columnToFilter;
     $this->filter();
     //		echo $this->table; exit;
 }
Exemplo n.º 20
0
 /**
  * Filter constructor.
  * 
  * @param Piwik_DataTable $table
  * @param int $offset Starting row (indexed from 0)
  * @param int $limit Number of rows to keep (specify -1 to keep all rows)
  */
 public function __construct($table, $offset, $limit = null)
 {
     parent::__construct($table);
     $this->offset = $offset;
     if (is_null($limit)) {
         $limit = -1;
     }
     $this->limit = $limit;
 }
Exemplo n.º 21
0
 /**
  * @param Piwik_DataTable  $table
  * @param string           $columnToFilter  name of the column to filter
  * @param float            $minimumValue    minimum value for range
  * @param float            $maximumValue    maximum value for range
  */
 public function __construct($table, $columnToFilter, $minimumValue = 0.0, $maximumValue = 100.0)
 {
     parent::__construct($table);
     $this->columnToFilter = $columnToFilter;
     if ($minimumValue < $maximumValue) {
         self::$minimumValue = $minimumValue;
         self::$maximumValue = $maximumValue;
     }
 }
 /**
  * @param Piwik_DataTable  $table
  * @param string           $columnToFilter
  * @param callback         $function
  * @param array            $functionParams
  */
 public function __construct($table, $columnToFilter, $function, $functionParams = array())
 {
     parent::__construct($table);
     if (!is_array($functionParams)) {
         $functionParams = array($functionParams);
     }
     $this->function = $function;
     $this->columnToFilter = $columnToFilter;
     $this->functionParams = $functionParams;
 }
Exemplo n.º 23
0
 /**
  * @param DataTable Table
  * @param array Mapping to apply. Must have the format 	
  * 				array( 	OLD_COLUMN_NAME => NEW_COLUMN NAME,
  * 						OLD_COLUMN_NAME2 => NEW_COLUMN NAME2,
  * 					)
  */
 public function __construct($table, $recursive = false, $mappingToApply = null)
 {
     parent::__construct($table);
     $this->mappingToApply = Piwik_Archive::$mappingFromIdToName;
     $this->applyFilterRecursively = $recursive;
     if (!is_null($mappingToApply)) {
         $this->mappingToApply = $mappingToApply;
     }
     $this->filter();
 }
Exemplo n.º 24
0
 public function __construct($table, $columnToSort, $order = 'desc', $naturalSort = true, $recursiveSort = false)
 {
     parent::__construct($table);
     if ($recursiveSort) {
         $table->enableRecursiveSort();
     }
     $this->columnToSort = $columnToSort;
     $this->naturalSort = $naturalSort;
     $this->setOrder($order);
 }
Exemplo n.º 25
0
 /**
  * Filter constructor.
  * 
  * @param Piwik_DataTable  $table
  * @param int              $offset          Starting row (indexed from 0)
  * @param int              $limit           Number of rows to keep (specify -1 to keep all rows)
  * @param bool             $keepSummaryRow  Whether to keep the summary row or not.
  */
 public function __construct($table, $offset, $limit = null, $keepSummaryRow = false)
 {
     parent::__construct($table);
     $this->offset = $offset;
     if (is_null($limit)) {
         $limit = -1;
     }
     $this->limit = $limit;
     $this->keepSummaryRow = $keepSummaryRow;
 }
Exemplo n.º 26
0
 /**
  * @param Piwik_DataTable  $table
  * @param array|string     $columnsToFilter
  * @param callback         $functionToApply
  * @param array|null       $functionParameters
  * @param array            $extraColumnParameters
  */
 public function __construct($table, $columnsToFilter, $functionToApply, $functionParameters = null, $extraColumnParameters = array())
 {
     parent::__construct($table);
     $this->functionToApply = $functionToApply;
     $this->functionParameters = $functionParameters;
     if (!is_array($columnsToFilter)) {
         $columnsToFilter = array($columnsToFilter);
     }
     $this->columnsToFilter = $columnsToFilter;
     $this->extraColumnParameters = $extraColumnParameters;
 }
Exemplo n.º 27
0
 /**
  * Constructor.
  * 
  * @param Piwik_DataTable  $table               The DataTable that will be filtered.
  * @param array|string     $columns             The names of the columns to pass to the callback.
  * @param string           $columnToAdd         The name of the column to add.
  * @param mixed            $functionToApply     The callback to apply to each row of a DataTable.
  * @param array            $functionParameters  Extra parameters to pass to $functionToApply.
  */
 public function __construct($table, $columns, $columnToAdd, $functionToApply, $functionParameters = array())
 {
     parent::__construct($table);
     if (!is_array($columns)) {
         $columns = array($columns);
     }
     $this->columns = $columns;
     $this->columnToAdd = $columnToAdd;
     $this->functionToApply = $functionToApply;
     $this->functionParameters = $functionParameters;
 }
 /**
  * @param Piwik_DataTable  $table
  * @param string|array     $metadataToRead
  * @param string           $metadataToAdd
  * @param callback         $functionToApply
  * @param bool	           $applyToSummaryRow
  */
 public function __construct($table, $metadataToRead, $metadataToAdd, $functionToApply, $applyToSummaryRow = true)
 {
     parent::__construct($table);
     $this->functionToApply = $functionToApply;
     if (!is_array($metadataToRead)) {
         $metadataToRead = array($metadataToRead);
     }
     $this->metadataToRead = $metadataToRead;
     $this->metadataToAdd = $metadataToAdd;
     $this->applyToSummaryRow = $applyToSummaryRow;
 }
Exemplo n.º 29
0
 public function __construct($table, $columnToSort, $order = 'desc', $naturalSort = false)
 {
     parent::__construct($table);
     // hack... But I can't see how to do properly
     if ($columnToSort == '0') {
         $columnToSort = 'label';
     }
     $this->columnToSort = $columnToSort;
     $this->naturalSort = $naturalSort;
     $this->setOrder($order);
     $this->filter();
 }
 /**
  * @param Piwik_DataTable $table
  * @param string $columnValueToRead
  * @param string $columnNamePercentageToAdd
  * @param numeric|string $totalValueUsedToComputePercentageOrColumnName 
  * 						if a numeric value is given, we use this value as the divisor to process the percentage. 
  * 						if a string is given, this string is the column name's value used as the divisor.
  * @param int $percentagePrecision precision 0 means "11", 1 means "11.2"
  */
 public function __construct($table, $columnValueToRead, $columnNamePercentageToAdd, $totalValueUsedToComputePercentageOrColumnName, $percentagePrecision = 0)
 {
     parent::__construct($table);
     $this->columnValueToRead = $columnValueToRead;
     $this->columnNamePercentageToAdd = $columnNamePercentageToAdd;
     if (is_numeric($totalValueUsedToComputePercentageOrColumnName)) {
         $this->totalValueUsedAsDivisor = $totalValueUsedToComputePercentageOrColumnName;
     } else {
         $this->columnNameUsedAsDivisor = $totalValueUsedToComputePercentageOrColumnName;
     }
     $this->percentagePrecision = $percentagePrecision;
     $this->filter();
 }