1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* WellCommerce Open-Source E-Commerce Platform |
4
|
|
|
* |
5
|
|
|
* This file is part of the WellCommerce package. |
6
|
|
|
* |
7
|
|
|
* (c) Adam Piotrowski <[email protected]> |
8
|
|
|
* |
9
|
|
|
* For the full copyright and license information, |
10
|
|
|
* please view the LICENSE file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
namespace WellCommerce\Bundle\CmsBundle\DataGrid; |
13
|
|
|
|
14
|
|
|
use WellCommerce\Bundle\CoreBundle\DataGrid\AbstractDataGrid; |
15
|
|
|
use WellCommerce\Component\DataGrid\Column\Column; |
16
|
|
|
use WellCommerce\Component\DataGrid\Column\ColumnCollection; |
17
|
|
|
use WellCommerce\Component\DataGrid\Column\Options\Appearance; |
18
|
|
|
use WellCommerce\Component\DataGrid\Column\Options\Filter; |
19
|
|
|
use WellCommerce\Component\DataGrid\Column\Options\Sorting; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Class NewsCategoryDataGrid |
23
|
|
|
* |
24
|
|
|
* @author Adam Piotrowski <[email protected]> |
25
|
|
|
*/ |
26
|
|
|
class NewsCategoryDataGrid extends AbstractDataGrid |
27
|
|
|
{ |
28
|
|
|
public function configureColumns(ColumnCollection $collection) |
29
|
|
|
{ |
30
|
|
|
$collection->add(new Column([ |
31
|
|
|
'id' => 'id', |
32
|
|
|
'caption' => 'common.label.id', |
33
|
|
|
'sorting' => new Sorting([ |
34
|
|
|
'default_order' => Sorting::SORT_DIR_DESC, |
35
|
|
|
]), |
36
|
|
|
'appearance' => new Appearance([ |
37
|
|
|
'width' => 90, |
38
|
|
|
'visible' => false, |
39
|
|
|
]), |
40
|
|
|
'filter' => new Filter([ |
41
|
|
|
'type' => Filter::FILTER_BETWEEN, |
42
|
|
|
]), |
43
|
|
|
])); |
44
|
|
|
|
45
|
|
|
$collection->add(new Column([ |
46
|
|
|
'id' => 'name', |
47
|
|
|
'caption' => 'common.label.name', |
48
|
|
|
])); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function getIdentifier(): string |
52
|
|
|
{ |
53
|
|
|
return 'news_category'; |
54
|
|
|
} |
55
|
|
|
} |
56
|
|
|
|