Completed
Pull Request — 3.1 (#347)
by Łukasz
16:49 queued 11:36
created

MyDependentCRUD::initForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace FSi\Bundle\AdminBundle\spec\fixtures;
13
14
use FSi\Bundle\AdminBundle\Admin\CRUD\DependentCRUDElement;
15
use FSi\Component\DataGrid\DataGridFactoryInterface;
16
use FSi\Component\DataGrid\DataGridInterface;
17
use FSi\Component\DataIndexer\DataIndexerInterface;
18
use FSi\Component\DataSource\DataSourceFactoryInterface;
19
use FSi\Component\DataSource\DataSourceInterface;
20
use Symfony\Component\Form\FormFactoryInterface;
21
use Symfony\Component\Form\FormInterface;
22
23
class MyDependentCRUD extends DependentCRUDElement
24
{
25
    public function getId(): string
26
    {
27
        return 'my_dependent_crud';
28
    }
29
30
    public function getParentId(): string
31
    {
32
    }
33
34
    public function getDataIndexer(): DataIndexerInterface
35
    {
36
    }
37
38
    public function save($object): void
39
    {
40
    }
41
42
    public function saveDataGrid(): void
43
    {
44
    }
45
46
    public function delete($object): void
47
    {
48
    }
49
50
    protected function initDataGrid(DataGridFactoryInterface $factory): DataGridInterface
51
    {
52
        return $factory->createDataGrid('my_datagrid');
53
    }
54
55
    protected function initDataSource(DataSourceFactoryInterface $factory): DataSourceInterface
56
    {
57
        return $factory->createDataSource('doctrine', ['entity' => 'FSiDemoBundle:MyEntity'], 'my_datasource');
58
    }
59
60
    protected function initForm(FormFactoryInterface $factory, $data = null): FormInterface
61
    {
62
        return $factory->create('form');
63
    }
64
}
65