1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file was created by developers working at BitBag |
||
5 | * Do you need more information about us and what we do? Visit our https://bitbag.io website! |
||
6 | * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career |
||
7 | */ |
||
8 | |||
9 | declare(strict_types=1); |
||
10 | |||
11 | namespace BitBag\SyliusCmsPlugin\Fixture; |
||
12 | |||
13 | use BitBag\SyliusCmsPlugin\Fixture\Factory\FixtureFactoryInterface; |
||
14 | use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture; |
||
15 | use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; |
||
16 | |||
17 | final class SectionFixture extends AbstractFixture |
||
18 | { |
||
19 | /** @var FixtureFactoryInterface */ |
||
20 | private $sectionFixtureFactory; |
||
21 | |||
22 | public function __construct(FixtureFactoryInterface $sectionFixtureFactory) |
||
23 | { |
||
24 | $this->sectionFixtureFactory = $sectionFixtureFactory; |
||
25 | } |
||
26 | |||
27 | public function load(array $options): void |
||
28 | { |
||
29 | $this->sectionFixtureFactory->load($options['custom']); |
||
30 | } |
||
31 | |||
32 | public function getName(): string |
||
33 | { |
||
34 | return 'section'; |
||
35 | } |
||
36 | |||
37 | protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void |
||
38 | { |
||
39 | $optionsNode |
||
40 | ->children() |
||
41 | ->arrayNode('custom') |
||
42 | ->arrayPrototype() |
||
43 | ->children() |
||
44 | ->booleanNode('remove_existing')->defaultTrue()->end() |
||
45 | ->arrayNode('translations') |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
46 | ->prototype('array') |
||
47 | ->children() |
||
48 | ->scalarNode('name')->defaultNull()->end() |
||
49 | ->end() |
||
50 | ->end() |
||
51 | ->end() |
||
52 | ->end() |
||
53 | ->end() |
||
54 | ->end() |
||
55 | ->end() |
||
56 | ; |
||
57 | } |
||
58 | } |
||
59 |