Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattpiwik <matthieu.aubry@gmail.com>2011-01-17 05:19:39 +0300
committermattpiwik <matthieu.aubry@gmail.com>2011-01-17 05:19:39 +0300
commit295c67416d54188033f65e040a06c4ef98a061e0 (patch)
tree7b307fbf23e4c10f96c66c8d04e705b0f2b10f75 /core/DataTable/Filter/Pattern.php
parent0bc09f2bcabf9da976a522cf69c3369ecd1bc308 (diff)
Fixes #173 - making all filters recursive by default (no performance impact since it won't load the tables if they were not loaded in the API). Updating all filters to reflect new abstract class signature
git-svn-id: http://dev.piwik.org/svn/trunk@3764 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/DataTable/Filter/Pattern.php')
-rw-r--r--core/DataTable/Filter/Pattern.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/DataTable/Filter/Pattern.php b/core/DataTable/Filter/Pattern.php
index 0d0aa7671d..22702d83ae 100644
--- a/core/DataTable/Filter/Pattern.php
+++ b/core/DataTable/Filter/Pattern.php
@@ -32,7 +32,7 @@ class Piwik_DataTable_Filter_Pattern extends Piwik_DataTable_Filter
$this->patternToSearchQuoted = self::getPatternQuoted($patternToSearch);
$this->columnToFilter = $columnToFilter;
$this->invertedMatch = $invertedMatch;
- $this->filter();
+ $this->filter($table);
}
static public function getPatternQuoted( $pattern )
@@ -48,9 +48,9 @@ class Piwik_DataTable_Filter_Pattern extends Piwik_DataTable_Filter
return @preg_match($patternQuoted . "i", $string) == 1 ^ $invertedMatch;
}
- protected function filter()
+ protected function filter($table)
{
- foreach($this->table->getRows() as $key => $row)
+ foreach($table->getRows() as $key => $row)
{
//instead search must handle
// - negative search with -piwik
@@ -58,7 +58,7 @@ class Piwik_DataTable_Filter_Pattern extends Piwik_DataTable_Filter
// see (?!pattern) A subexpression that performs a negative lookahead search, which matches the search string at any point where a string not matching pattern begins.
if( !self::match($this->patternToSearch, $this->patternToSearchQuoted, $row->getColumn($this->columnToFilter), $this->invertedMatch))
{
- $this->table->deleteRow($key);
+ $table->deleteRow($key);
}
}
}