DateDataType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAvailableFilterMethods() 0 11 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 DateDataType 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_DATETIME_GT,
18
            FilterCondition::METHOD_DATETIME_GTE,
19
            FilterCondition::METHOD_DATETIME_EQ,
20
            FilterCondition::METHOD_DATETIME_LTE,
21
            FilterCondition::METHOD_DATETIME_LT,
22
            FilterCondition::METHOD_DATETIME_NEQ,
23
        ];
24
    }
25
26
    /**
27
     * Return the identifier of the default sort method
28
     *
29
     * @return int
30
     */
31
    public function getDefaultFilterMethod()
32
    {
33
        return FilterCondition::METHOD_DATETIME_EQ;
34
    }
35
36
    /**
37
     * Return the name of the type, unique.
38
     *
39
     * @return string
40
     */
41
    public function getName()
42
    {
43
        return 'date';
44
    }
45
}
46