Code Duplication    Length = 3-3 lines in 2 locations

ORM/Repository.php 2 locations

@@ 151-153 (lines=3) @@
148
            $search->setFrom($offset);
149
        }
150
151
        foreach ($criteria as $field => $value) {
152
            $search->addQuery(new TermsQuery($field, is_array($value) ? $value : [$value]), 'must');
153
        }
154
155
        foreach ($orderBy as $field => $direction) {
156
            $search->addSort(new Sort($field, strcasecmp($direction, 'asc') == 0 ? Sort::ORDER_ASC : Sort::ORDER_DESC));
@@ 176-178 (lines=3) @@
173
        $search = $this->createSearch();
174
        $search->setSize(1);
175
176
        foreach ($criteria as $field => $value) {
177
            $search->addQuery(new TermsQuery($field, is_array($value) ? $value : [$value]), 'must');
178
        }
179
180
        foreach ($orderBy as $field => $direction) {
181
            $search->addSort(new Sort($field, strcasecmp($direction, 'asc') == 0 ? Sort::ORDER_ASC : Sort::ORDER_DESC));