1 | <?php |
||
21 | final class RateFilterUtil |
||
22 | { |
||
23 | private function __construct() { } |
||
24 | |||
25 | /** |
||
26 | * Check if rate matches filters. |
||
27 | * |
||
28 | * @param RateInterface $rate Rate to filter. |
||
29 | * @param array $criteria Filter criteria. |
||
30 | * @return bool TRUE if filter criteria is matched. |
||
31 | */ |
||
32 | 8 | public static function matches(RateInterface $rate, array $criteria) |
|
48 | |||
49 | /** |
||
50 | * Check if date criteria is matched. |
||
51 | * |
||
52 | * @param string $key Date criteria key. |
||
53 | * @param RateInterface $rate Rate to check for match. |
||
54 | * @param array $criteria Filter criterias. |
||
55 | * @return bool TRUE if there is a match. |
||
56 | */ |
||
57 | 8 | private static function matchesDateCriteria($key, RateInterface $rate, array $criteria) |
|
73 | |||
74 | /** |
||
75 | * Check if array|string criteria is matched. |
||
76 | * |
||
77 | * @param string $key Array|string criteria key. |
||
78 | * @param RateInterface $rate Rate to check for match. |
||
79 | * @param array $criteria Filter criterias. |
||
80 | * @return bool TRUE if there is a match. |
||
81 | */ |
||
82 | 8 | private static function matchesArrayCriteria($key, RateInterface $rate, array $criteria) |
|
92 | |||
93 | /** |
||
94 | * Extract array criteria from criterias. |
||
95 | * |
||
96 | * @param string $key Criteria name. |
||
97 | * @param array $criteria Filter criterias. |
||
98 | * @return array Extracted array criterias. |
||
99 | */ |
||
100 | 8 | private static function extractArrayCriteria($key, array $criteria) |
|
110 | |||
111 | /** |
||
112 | * Extract date from filter criterias. |
||
113 | * |
||
114 | * @param string $key Criteria name. |
||
115 | * @param array $criteria Filter criterias. |
||
116 | * @return \DateTime|null Extracted date criteria. |
||
117 | */ |
||
118 | 8 | private static function extractDateCriteria($key, array $criteria) |
|
122 | } |
||
123 |