Skip to content

Commit

Permalink
+ Support for many tags in tag decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaselkowski committed Sep 5, 2017
1 parent 2c202d5 commit b8f960a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/Decorators/QueryBuilder/TagDecorator.php
Expand Up @@ -41,19 +41,26 @@ public function decorate(&$conditions, SearchCriteria $criteria)
{
return;
}
foreach($matches as $group)
if(count($matches[0]) > 1)
{
echo '';
}
foreach($matches[0] as $match)
{
$match = $group[0];
$query = str_replace($match, '', $query);
$criteria->addCond($this->field, '==', trim($match, '[]'));
$conditions[] = [
'term' => [
$this->field => trim($match, '[]')
]
];
}

$criteria->search($query);
}

public function getKind()
{
return false;
return self::KindFilter;
}

}

0 comments on commit b8f960a

Please sign in to comment.