Author: Adam Piotrowski (adam@wellcommerce.org)
Inheritance: extends WellCommerce\Bundle\DoctrineBundle\Entity\AbstractEntity, implements WellCommerce\Bundle\LayoutBundle\Entity\LayoutBoxInterface, use trait Knp\DoctrineBehaviors\Model\Timestampable\Timestampable, use trait Knp\DoctrineBehaviors\Model\Translatable\Translatable, use trait Knp\DoctrineBehaviors\Model\Blameable\Blameable
コード例 #1
0
 public function create() : LayoutBoxInterface
 {
     $box = new LayoutBox();
     $box->setBoxType('');
     $box->setIdentifier('');
     $box->setSettings([]);
     return $box;
 }
コード例 #2
0
 /**
  * {@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);
 }
コード例 #3
0
 /**
  * @return \WellCommerce\Bundle\LayoutBundle\Entity\LayoutBoxInterface
  */
 public function create()
 {
     $box = new LayoutBox();
     $box->setIdentifier('');
     return $box;
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 public function add(LayoutBox $box)
 {
     $this->items[$box->getIdentifier()] = $box;
 }