columnToRead = $columnToRead; $this->limitPositive = (int) $limitPositiveValues; $this->limitNegative = (int) $limitNegativeValues; } public function filter($table) { $countIncreaser = 0; $countDecreaser = 0; foreach ($table->getRows() as $key => $row) { if ($row->getColumn($this->columnToRead) >= 0) { $countIncreaser++; if ($countIncreaser > $this->limitPositive) { $table->deleteRow($key); } } else { $countDecreaser++; if ($countDecreaser > $this->limitNegative) { $table->deleteRow($key); } } } } }