| @@ 46-61 (lines=16) @@ | ||
| 43 | /** |
|
| 44 | * Returns this object as array. |
|
| 45 | */ |
|
| 46 | public function toArray() |
|
| 47 | { |
|
| 48 | $options = array( |
|
| 49 | 'filter_type' => $this->getFilterType(), |
|
| 50 | 'selector' => $this->getSelector(), |
|
| 51 | ); |
|
| 52 | ||
| 53 | // Remove options with empty values |
|
| 54 | $cleanedOptions = array(); |
|
| 55 | foreach ($options as $name=>$value) { |
|
| 56 | if ($value!==null) |
|
| 57 | $cleanedOptions[$name] = $value; |
|
| 58 | } |
|
| 59 | ||
| 60 | return $cleanedOptions; |
|
| 61 | } |
|
| 62 | ||
| 63 | public function getFilterType() |
|
| 64 | { |
|
| @@ 39-53 (lines=15) @@ | ||
| 36 | /** |
|
| 37 | * Returns this object as array. |
|
| 38 | */ |
|
| 39 | public function toArray() |
|
| 40 | { |
|
| 41 | $options = array( |
|
| 42 | 'selector' => $this->getSelector(), |
|
| 43 | ); |
|
| 44 | ||
| 45 | // Remove options with empty values |
|
| 46 | $cleanedOptions = array(); |
|
| 47 | foreach ($options as $name=>$value) { |
|
| 48 | if ($value!==null) |
|
| 49 | $cleanedOptions[$name] = $value; |
|
| 50 | } |
|
| 51 | ||
| 52 | return $cleanedOptions; |
|
| 53 | } |
|
| 54 | ||
| 55 | public function getSelector() |
|
| 56 | { |
|