예제 #1
0
 /**
  * Constructor.
  * 
  * @param DataTable $table The DataTable that will eventually be filtered.
  * @param array|string $metadataToFilter The metadata whose values should be passed to the callback
  *                                       and then replaced with the callback's result.
  * @param callable $functionToApply The function to execute. Must take the metadata value as a parameter
  *                                  and return a value that will be used to replace the original.
  * @param array|null $functionParameters deprecated - use an [anonymous function](http://php.net/manual/en/functions.anonymous.php)
  *                                       instead.
  * @param array $extraColumnParameters Extra column values that should be passed to the callback, but
  *                                     shouldn't be replaced.
  */
 public function __construct($table, $metadataToFilter, $functionToApply, $functionParameters = null, $extraColumnParameters = array())
 {
     parent::__construct($table, $metadataToFilter, $functionToApply, $functionParameters, $extraColumnParameters);
 }
 /**
  * Constructor.
  *
  * @param DataTable $table The DataTable that will be filtered.
  * @param string $labelSingular The string to use when the range being beautified
  *                              is equal to '1-1 units', eg `"1 visit"`.
  * @param string $labelPlural The string to use when the range being beautified
  *                            references more than one unit. This must be a format
  *                            string that takes one string parameter, eg, `"%s visits"`.
  */
 public function __construct($table, $labelSingular, $labelPlural)
 {
     parent::__construct($table, 'label', array($this, 'beautify'), array());
     $this->labelSingular = $labelSingular;
     $this->labelPlural = $labelPlural;
 }
예제 #3
0
 /**
  * Constructor.
  *
  * @param DataTable $table The table to eventually filter.
  */
 public function __construct($table)
 {
     parent::__construct($table, 'label', 'Piwik\\Plugins\\Referrers\\API::getCleanKeyword');
 }