Completed
Push — master ( aa2dbb...5f8e8d )
by
unknown
02:19
created

SearchTextDataType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAvailableFilterMethods() 0 7 1
A getDefaultFilterMethod() 0 4 1
A getName() 0 4 1
1
<?php
2
3
namespace Netdudes\DataSourceryBundle\DataType;
4
5
use Netdudes\DataSourceryBundle\Query\FilterCondition;
6
7
class SearchTextDataType extends AbstractDataType
8
{
9
    /**
10
     * Return an array of available filter methods
11
     *
12
     * @return array
13
     */
14
    public function getAvailableFilterMethods()
15
    {
16
        return [
17
            FilterCondition::METHOD_STRING_EQ,
18
            FilterCondition::METHOD_STRING_LIKE,
19
        ];
20
    }
21
22
    /**
23
     * Return the identifier of the default sort method
24
     *
25
     * @return int
26
     */
27
    public function getDefaultFilterMethod()
28
    {
29
        return FilterCondition::METHOD_STRING_LIKE;
30
    }
31
32
    /**
33
     * Return the name of the type, unique.
34
     *
35
     * @return string
36
     */
37
    public function getName()
38
    {
39
        return 'search_text';
40
    }
41
}
42