diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-04-10 15:18:20 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-04-10 15:18:20 -0400 |
commit | 9f0166502b8b8886156bcb4ad0497cd9ee5a60b2 (patch) | |
tree | 425f829d3ace03eec5cbcaddf667d752046d75c6 /app/Filter/BaseFilter.php | |
parent | 2eadfb22912d94e76a479b694070735fbb0298f1 (diff) |
Added search in activity stream
Diffstat (limited to 'app/Filter/BaseFilter.php')
-rw-r--r-- | app/Filter/BaseFilter.php | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/app/Filter/BaseFilter.php b/app/Filter/BaseFilter.php index a7e6a61a..79a664be 100644 --- a/app/Filter/BaseFilter.php +++ b/app/Filter/BaseFilter.php @@ -72,48 +72,4 @@ abstract class BaseFilter $this->value = $value; return $this; } - - /** - * Parse operator in the input string - * - * @access protected - * @return string - */ - protected function parseOperator() - { - $operators = array( - '<=' => 'lte', - '>=' => 'gte', - '<' => 'lt', - '>' => 'gt', - ); - - foreach ($operators as $operator => $method) { - if (strpos($this->value, $operator) === 0) { - $this->value = substr($this->value, strlen($operator)); - return $method; - } - } - - return ''; - } - - /** - * Apply a date filter - * - * @access protected - * @param string $field - */ - protected function applyDateFilter($field) - { - $timestamp = strtotime($this->value); - $method = $this->parseOperator(); - - if ($method !== '') { - $this->query->$method($field, $timestamp); - } else { - $this->query->gte($field, $timestamp); - $this->query->lte($field, $timestamp + 86399); - } - } } |