@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | /** |
186 | 186 | * Set icon |
187 | 187 | * @param string|callable $icon |
188 | - * @return static|callable |
|
188 | + * @return Action |
|
189 | 189 | * @throws DataGridException |
190 | 190 | */ |
191 | 191 | public function setIcon($icon) |
@@ -270,7 +270,8 @@ discard block |
||
270 | 270 | |
271 | 271 | /** |
272 | 272 | * Check whether given property is string or callable |
273 | - * @param mixed $property |
|
273 | + * @param callable $property |
|
274 | + * @param string $name |
|
274 | 275 | * @return void |
275 | 276 | * @throws DataGridException |
276 | 277 | */ |
@@ -10,7 +10,6 @@ |
||
10 | 10 | |
11 | 11 | use Nette\Utils\Html; |
12 | 12 | use Ublaboo\DataGrid\DataGrid; |
13 | -use Ublaboo\DataGrid\Exception\DataGridHasToBeAttachedToPresenterComponentException; |
|
14 | 13 | use Ublaboo\DataGrid\Exception\DataGridException; |
15 | 14 | use Ublaboo\DataGrid\Exception\DataGridColumnRendererException; |
16 | 15 | use Ublaboo\DataGrid\Row; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | $this->key = $key; |
50 | 50 | |
51 | - $this->setTemplate(__DIR__ . '/../templates/column_status.latte'); |
|
51 | + $this->setTemplate(__DIR__.'/../templates/column_status.latte'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 |
@@ -219,7 +219,7 @@ |
||
219 | 219 | /** |
220 | 220 | * @param string $key |
221 | 221 | * @param Column\Column $column |
222 | - * @return void |
|
222 | + * @return Column\Column |
|
223 | 223 | */ |
224 | 224 | public function applyColumnCallback($key, Column\Column $column) |
225 | 225 | { |
@@ -8,8 +8,6 @@ |
||
8 | 8 | |
9 | 9 | namespace Ublaboo\DataGrid\GroupAction; |
10 | 10 | |
11 | -use Nette; |
|
12 | - |
|
13 | 11 | /** |
14 | 12 | * @method void onSelect() |
15 | 13 | */ |
@@ -192,7 +192,7 @@ |
||
192 | 192 | */ |
193 | 193 | foreach ($sorting->getSort() as $column => $order) { |
194 | 194 | $this->sort_column = $column; |
195 | - $this->order_column = $order; |
|
195 | + $this->order_column = $order; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | return $this; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * Filter by multi select value |
170 | 170 | * @param mixed $row |
171 | 171 | * @param FilterMultiSelect $filter |
172 | - * @return void |
|
172 | + * @return boolean |
|
173 | 173 | */ |
174 | 174 | public function applyFilterMultiSelect($row, FilterMultiSelect $filter) |
175 | 175 | { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | /** |
184 | 184 | * @param mixed $row |
185 | 185 | * @param FilterRange $filter |
186 | - * @return void |
|
186 | + * @return boolean |
|
187 | 187 | */ |
188 | 188 | public function applyFilterRange($row, FilterRange $filter) |
189 | 189 | { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | /** |
210 | 210 | * @param mixed $row |
211 | 211 | * @param FilterDateRange $filter |
212 | - * @return void |
|
212 | + * @return boolean |
|
213 | 213 | */ |
214 | 214 | public function applyFilterDateRange($row, FilterDateRange $filter) |
215 | 215 | { |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | * Apply fitler date and tell whether row value matches or not |
271 | 271 | * @param mixed $row |
272 | 272 | * @param Filter $filter |
273 | - * @return mixed |
|
273 | + * @return boolean|null |
|
274 | 274 | */ |
275 | 275 | protected function applyFilterDate($row, FilterDate $filter) |
276 | 276 | { |
@@ -14,9 +14,7 @@ |
||
14 | 14 | use Ublaboo\DataGrid\Filter\FilterRange; |
15 | 15 | use Ublaboo\DataGrid\Filter\FilterDateRange; |
16 | 16 | use Ublaboo\DataGrid\Filter\FilterText; |
17 | -use Nette\Utils\Callback; |
|
18 | 17 | use Nette\Utils\Strings; |
19 | -use Ublaboo\DataGrid\Exception\DataGridException; |
|
20 | 18 | use Ublaboo\DataGrid\Exception\DataGridArrayDataSourceException; |
21 | 19 | use Ublaboo\DataGrid\Exception\DataGridDateTimeHelperException; |
22 | 20 | use Ublaboo\DataGrid\Utils\DateTimeHelper; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | foreach ($items as $item) { |
397 | 397 | $rows[] = $row = new Row($this, $item, $this->getPrimaryKey()); |
398 | 398 | |
399 | - if (!$hasGroupActionOnRows && $row->hasGroupAction()){ |
|
399 | + if (!$hasGroupActionOnRows && $row->hasGroupAction()) { |
|
400 | 400 | $hasGroupActionOnRows = TRUE; |
401 | 401 | } |
402 | 402 | |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | } |
414 | 414 | } |
415 | 415 | |
416 | - if ($hasGroupActionOnRows){ |
|
416 | + if ($hasGroupActionOnRows) { |
|
417 | 417 | $hasGroupActionOnRows = $this->hasGroupActions(); |
418 | 418 | } |
419 | 419 | |
@@ -2762,7 +2762,7 @@ discard block |
||
2762 | 2762 | |
2763 | 2763 | if (!($parent instanceof PresenterComponent)) { |
2764 | 2764 | throw new DataGridHasToBeAttachedToPresenterComponentException( |
2765 | - "DataGrid is attached to: '" . get_class($parent) . "', but instance of PresenterComponent is needed." |
|
2765 | + "DataGrid is attached to: '".get_class($parent)."', but instance of PresenterComponent is needed." |
|
2766 | 2766 | ); |
2767 | 2767 | } |
2768 | 2768 |
@@ -18,7 +18,6 @@ |
||
18 | 18 | use Ublaboo\DataGrid\Exception\DataGridFilterNotFoundException; |
19 | 19 | use Ublaboo\DataGrid\Exception\DataGridHasToBeAttachedToPresenterComponentException; |
20 | 20 | use Ublaboo\DataGrid\Filter\IFilterDate; |
21 | -use Ublaboo\DataGrid\Utils\DateTimeHelper; |
|
22 | 21 | use Ublaboo\DataGrid\Utils\Sorting; |
23 | 22 | use Ublaboo\DataGrid\InlineEdit\InlineEdit; |
24 | 23 | use Ublaboo\DataGrid\ColumnsSummary; |
@@ -1428,7 +1428,6 @@ discard block |
||
1428 | 1428 | |
1429 | 1429 | /** |
1430 | 1430 | * If we want to sent some initial filter |
1431 | - * @param array $filter |
|
1432 | 1431 | * @param bool $use_on_reset |
1433 | 1432 | * @return static |
1434 | 1433 | */ |
@@ -2499,7 +2498,7 @@ discard block |
||
2499 | 2498 | |
2500 | 2499 | /** |
2501 | 2500 | * Set options of select "items_per_page" |
2502 | - * @param array $items_per_page_list |
|
2501 | + * @param integer[] $items_per_page_list |
|
2503 | 2502 | * @return static |
2504 | 2503 | */ |
2505 | 2504 | public function setItemsPerPageList(array $items_per_page_list, $include_all = TRUE) |
@@ -2818,7 +2817,7 @@ discard block |
||
2818 | 2817 | |
2819 | 2818 | /** |
2820 | 2819 | * Get items detail parameters |
2821 | - * @return array |
|
2820 | + * @return Column\ItemDetail |
|
2822 | 2821 | */ |
2823 | 2822 | public function getItemsDetail() |
2824 | 2823 | { |
@@ -2892,7 +2891,7 @@ discard block |
||
2892 | 2891 | |
2893 | 2892 | |
2894 | 2893 | /** |
2895 | - * @return Nette\Forms\Container|NULL |
|
2894 | + * @return Utils\ItemDetailForm|null |
|
2896 | 2895 | */ |
2897 | 2896 | public function getItemDetailForm() |
2898 | 2897 | { |
@@ -108,7 +108,7 @@ |
||
108 | 108 | $element = $a; |
109 | 109 | |
110 | 110 | if ($this->icon) { |
111 | - $a->addHtml(Html::el('span')->class(DataGrid::$icon_prefix . $this->icon)); |
|
111 | + $a->addHtml(Html::el('span')->class(DataGrid::$icon_prefix.$this->icon)); |
|
112 | 112 | |
113 | 113 | if (strlen($value)) { |
114 | 114 | $a->addHtml(' '); |
@@ -11,7 +11,6 @@ |
||
11 | 11 | use Nette\Utils\Html; |
12 | 12 | use Ublaboo\DataGrid\DataGrid; |
13 | 13 | use Ublaboo\DataGrid\Row; |
14 | -use Ublaboo\DataGrid\Exception\DataGridHasToBeAttachedToPresenterComponentException; |
|
15 | 14 | use Ublaboo\DataGrid\Exception\DataGridColumnRendererException; |
16 | 15 | |
17 | 16 | class ColumnLink extends Column |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | return $this->data_source->count( |
63 | - $this->data_source->getName() . '.' . (is_array($primary) ? reset($primary) : $primary) |
|
63 | + $this->data_source->getName().'.'.(is_array($primary) ? reset($primary) : $primary) |
|
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | $like = '('; |
172 | 172 | $args = []; |
173 | 173 | |
174 | - if($filter->isExactSearch()){ |
|
175 | - $like .= "$column = ? OR "; |
|
174 | + if ($filter->isExactSearch()) { |
|
175 | + $like .= "$column = ? OR "; |
|
176 | 176 | $args[] = "$value"; |
177 | 177 | } else { |
178 | 178 | if ($filter->hasSplitWordsSearch() === FALSE) { |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $args[] = "%$word%"; |
186 | 186 | } |
187 | 187 | } |
188 | - $like = substr($like, 0, strlen($like) - 4) . ')'; |
|
188 | + $like = substr($like, 0, strlen($like) - 4).')'; |
|
189 | 189 | |
190 | 190 | $or[] = $like; |
191 | 191 | $big_or .= "$like OR "; |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | |
224 | 224 | foreach ($values as $value) { |
225 | 225 | if ($i == $length) { |
226 | - $or .= $filter->getColumn() . ' = ?)'; |
|
226 | + $or .= $filter->getColumn().' = ?)'; |
|
227 | 227 | } else { |
228 | - $or .= $filter->getColumn() . ' = ? OR '; |
|
228 | + $or .= $filter->getColumn().' = ? OR '; |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | $i++; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | call_user_func_array([$this->data_source, 'where'], $values); |
237 | 237 | } else { |
238 | - $this->data_source->where($filter->getColumn() . ' = ?', reset($values)); |
|
238 | + $this->data_source->where($filter->getColumn().' = ?', reset($values)); |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 |