Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public static function newSearch(array $rawSearch) { |
||
33 | |||
34 | // Initialize a DataTables search. |
||
35 | $dtSearch = new DataTablesSearch(); |
||
36 | |||
37 | // Determines if the raw search is valid. |
||
38 | if (false === array_key_exists(DataTablesSearchInterface::DATATABLES_PARAMETER_REGEX, $rawSearch)) { |
||
39 | return $dtSearch; |
||
40 | } |
||
41 | if (false === array_key_exists(DataTablesSearchInterface::DATATABLES_PARAMETER_VALUE, $rawSearch)) { |
||
42 | return $dtSearch; |
||
43 | } |
||
44 | |||
45 | // Set the search. |
||
46 | $dtSearch->setRegex(BooleanHelper::parseString($rawSearch[DataTablesSearchInterface::DATATABLES_PARAMETER_REGEX])); |
||
47 | $dtSearch->setValue($rawSearch[DataTablesSearchInterface::DATATABLES_PARAMETER_VALUE]); |
||
48 | |||
49 | // Return the search. |
||
50 | return $dtSearch; |
||
51 | } |
||
52 | |||
54 |