/** * {@inheritdoc} */ public function resolveControllerService(LayoutBoxInterface $layoutBox) { $boxType = $layoutBox->getBoxType(); $configurator = $this->layoutBoxConfiguratorCollection->get($boxType); $service = $configurator->getControllerService(); if (!$this->container->has($service)) { throw new ServiceNotFoundException($service); } return $this->container->get($service); }
private function makeSettingsCollection(LayoutBoxInterface $box, array $params = []) : LayoutBoxSettingsCollection { $defaultSettings = $box->getSettings(); $settings = array_merge($defaultSettings, $params); $collection = new LayoutBoxSettingsCollection(); foreach ($settings as $name => $value) { $collection->add($name, $value); } $collection->add('name', $box->translate()->getName()); $collection->add('content', $box->translate()->getContent()); return $collection; }