Completed
Push — master ( 650132...5e5f70 )
by Simonas
8s
created

AbstractSingleValue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getViewData() 0 4 1
A preProcessSearch() 0 4 1
A isRelated() 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
    /**
46
     * {@inheritdoc}
47
     */
48
    public function isRelated()
49
    {
50
        return false;
51
    }
52
}
53