| Conditions | 3 |
| Paths | 2 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function createMenu(array $options = []): ItemInterface |
||
| 30 | { |
||
| 31 | $menu = $this->factory->createItem('root'); |
||
| 32 | |||
| 33 | if (!array_key_exists('brand', $options) || !$options['brand'] instanceof BrandInterface) { |
||
| 34 | return $menu; |
||
| 35 | } |
||
| 36 | |||
| 37 | $menu |
||
| 38 | ->addChild('details') |
||
| 39 | ->setAttribute('template', '@LoevgaardSyliusBrandPlugin/Admin/Brand/Tab/_details.html.twig') |
||
| 40 | ->setLabel('sylius.ui.details') |
||
| 41 | ->setCurrent(true) |
||
| 42 | ; |
||
| 43 | |||
| 44 | $menu |
||
| 45 | ->addChild('media') |
||
| 46 | ->setAttribute('template', '@LoevgaardSyliusBrandPlugin/Admin/Brand/Tab/_media.html.twig') |
||
| 47 | ->setLabel('sylius.ui.media') |
||
| 48 | ; |
||
| 49 | |||
| 50 | $this->eventDispatcher->dispatch( |
||
| 51 | self::EVENT_NAME, |
||
| 52 | new BrandMenuBuilderEvent($this->factory, $menu, $options['brand']) |
||
| 53 | ); |
||
| 54 | |||
| 55 | return $menu; |
||
| 56 | } |
||
| 58 |