/** * {@inheritdoc} */ public function resolveControllerService(LayoutBox $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); }
/** * @return \WellCommerce\AppBundle\Entity\LayoutBoxInterface */ public function create() { $box = new LayoutBox(); $box->setIdentifier(''); return $box; }
public function add(LayoutBox $box) { $this->items[$box->getIdentifier()] = $box; }
protected function createLayoutBox($type, $identifier, $name, $settings = []) { $layoutBox = new LayoutBox(); $layoutBox->setBoxType($type); $layoutBox->setIdentifier($identifier); $layoutBox->setSettings($settings); $layoutBox->translate('en')->setName($name); $layoutBox->mergeNewTranslations(); $this->manager->persist($layoutBox); }