Completed
Push — master ( 7d3672...a34d6f )
by Simonas
357:48 queued 292:56
created

AbstractSingleValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getViewData() 0 4 1
A preProcessSearch() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\FilterManagerBundle\Filter\Widget\Search;
13
14
use ONGR\ElasticsearchDSL\Search;
15
use ONGR\ElasticsearchBundle\Result\DocumentIterator;
16
use ONGR\FilterManagerBundle\Filter\FilterState;
17
use ONGR\FilterManagerBundle\Filter\Helper\FieldAwareInterface;
18
use ONGR\FilterManagerBundle\Filter\Helper\FieldAwareTrait;
19
use ONGR\FilterManagerBundle\Filter\ViewData;
20
use ONGR\FilterManagerBundle\Filter\Widget\AbstractSingleRequestValueFilter;
21
22
/**
23
 * This class generalises filters for single value searching.
24
 */
25
abstract class AbstractSingleValue extends AbstractSingleRequestValueFilter implements FieldAwareInterface
26
{
27
    use FieldAwareTrait;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function getViewData(DocumentIterator $result, ViewData $data)
33
    {
34
        return $data;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function preProcessSearch(Search $search, Search $relatedSearch, FilterState $state = null)
41
    {
42
        // Nothing more to do here.
43
    }
44
}
45