From fa251e60b6fc01f4012dae905f30889ff9ebdd3a Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 28 Feb 2014 20:54:25 +0100 Subject: [PATCH] Added :like and :dislike search aliases --- src/Models/SearchParsers/PostSearchParser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Models/SearchParsers/PostSearchParser.php b/src/Models/SearchParsers/PostSearchParser.php index cf8960b0..282c6781 100644 --- a/src/Models/SearchParsers/PostSearchParser.php +++ b/src/Models/SearchParsers/PostSearchParser.php @@ -145,7 +145,7 @@ class PostSearchParser extends AbstractSearchParser { $context = \Chibi\Registry::getContext(); $value = strtolower($value); - if (in_array($value, ['liked', 'likes'])) + if (in_array($value, ['like', 'liked', 'likes'])) { if (!$this->statement->isTableJoined('post_score')) { @@ -156,7 +156,7 @@ class PostSearchParser extends AbstractSearchParser return new Sql\EqualsFunctor(new Sql\IfNullFunctor('post_score.score', '0'), '1'); } - elseif (in_array($value, ['disliked', 'dislikes'])) + elseif (in_array($value, ['dislike', 'disliked', 'dislikes'])) { if (!$this->statement->isTableJoined('post_score')) {