| 1 | <?php |
||
| 9 | class CustomSubscriber extends ListElement |
||
| 10 | { |
||
| 11 | public function getId() |
||
| 12 | { |
||
| 13 | return 'custom_subscriber'; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function getClassName() |
||
| 17 | { |
||
| 18 | return 'FSi\FixturesBundle\Entity\Subscriber'; |
||
| 19 | } |
||
| 20 | |||
| 21 | protected function initDataGrid(DataGridFactoryInterface $factory) |
||
| 22 | { |
||
| 23 | /* @var $datagrid \FSi\Component\DataGrid\DataGrid */ |
||
| 24 | $datagrid = $factory->createDataGrid('subscriber'); |
||
| 25 | |||
| 26 | return $datagrid; |
||
| 27 | } |
||
| 28 | |||
| 29 | protected function initDataSource(DataSourceFactoryInterface $factory) |
||
| 30 | { |
||
| 31 | /* @var $datasource \FSi\Component\DataSource\DataSource */ |
||
| 32 | $datasource = $factory->createDataSource('doctrine', ['entity' => $this->getClassName()], 'subscriber'); |
||
| 33 | |||
| 34 | return $datasource; |
||
| 35 | } |
||
| 36 | } |
||
| 37 |