@@ -287,12 +287,12 @@ |
||
| 287 | 287 | return $this; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - /** |
|
| 291 | - * Adjust column from DataGrid 'foreignKey.column' to Nextras 'this->foreignKey->column' |
|
| 292 | - * @param string $column |
|
| 293 | - * @return string |
|
| 294 | - */ |
|
| 295 | - private function prepareColumn($column) { |
|
| 290 | + /** |
|
| 291 | + * Adjust column from DataGrid 'foreignKey.column' to Nextras 'this->foreignKey->column' |
|
| 292 | + * @param string $column |
|
| 293 | + * @return string |
|
| 294 | + */ |
|
| 295 | + private function prepareColumn($column) { |
|
| 296 | 296 | if (Strings::contains($column, '.')) { |
| 297 | 297 | return 'this->' . str_replace('.', '->', $column); |
| 298 | 298 | } |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $date_end = clone $date; |
| 102 | 102 | |
| 103 | 103 | $this->data_source = $this->data_source->findBy([ |
| 104 | - $this->prepareColumn($column) . '>=' => $date->setTime(0, 0, 0), |
|
| 105 | - $this->prepareColumn($column) . '<=' => $date_end->setTime(23, 59, 59) |
|
| 104 | + $this->prepareColumn($column).'>=' => $date->setTime(0, 0, 0), |
|
| 105 | + $this->prepareColumn($column).'<=' => $date_end->setTime(23, 59, 59) |
|
| 106 | 106 | ]); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -125,12 +125,12 @@ discard block |
||
| 125 | 125 | $dataCondition = []; |
| 126 | 126 | if ($value_from) { |
| 127 | 127 | $date_from = \DateTime::createFromFormat($filter->getPhpFormat(), $value_from); |
| 128 | - $dataCondition[$this->prepareColumn($filter->getColumn()) . '>='] = $date_from->setTime(0, 0, 0); |
|
| 128 | + $dataCondition[$this->prepareColumn($filter->getColumn()).'>='] = $date_from->setTime(0, 0, 0); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if ($value_to) { |
| 132 | 132 | $date_to = \DateTime::createFromFormat($filter->getPhpFormat(), $value_to); |
| 133 | - $dataCondition[$this->prepareColumn($filter->getColumn()) . '<='] = $date_to->setTime(23, 59, 59); |
|
| 133 | + $dataCondition[$this->prepareColumn($filter->getColumn()).'<='] = $date_to->setTime(23, 59, 59); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (!empty($dataCondition)) { |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | $dataCondition = []; |
| 155 | 155 | |
| 156 | 156 | if ($value_from) { |
| 157 | - $dataCondition[$this->prepareColumn($filter->getColumn()) . '>='] = $value_from; |
|
| 157 | + $dataCondition[$this->prepareColumn($filter->getColumn()).'>='] = $value_from; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | if ($value_to) { |
| 161 | - $dataCondition[$this->prepareColumn($filter->getColumn()) . '<='] = $value_to; |
|
| 161 | + $dataCondition[$this->prepareColumn($filter->getColumn()).'<='] = $value_to; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (!empty($dataCondition)) { |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | private function prepareColumn($column) { |
| 296 | 296 | if (Strings::contains($column, '.')) { |
| 297 | - return 'this->' . str_replace('.', '->', $column); |
|
| 297 | + return 'this->'.str_replace('.', '->', $column); |
|
| 298 | 298 | } |
| 299 | 299 | return $column; |
| 300 | 300 | } |