Пример #1
0
 /**
  * Constructor
  *
  * @param Slot                       $slot
  * @param PageBlocksInterface        $pageContentsContainer
  * @param FactoryRepositoryInterface $factoryRepository
  *
  * @api
  */
 public function __construct(Slot $slot, PageBlocksInterface $pageContentsContainer, FactoryRepositoryInterface $factoryRepository)
 {
     $this->slot = $slot;
     $this->pageContentsContainer = $pageContentsContainer;
     $this->factoryRepository = $factoryRepository;
     $this->languageRepository = $this->factoryRepository->createRepository('Language');
     $this->pageRepository = $this->factoryRepository->createRepository('Page');
     $this->blockRepository = $this->factoryRepository->createRepository('Block');
     $slotBlocks = $this->pageContentsContainer->getSlotBlocks($this->slot->getSlotName());
     $this->blocksToArray($slotBlocks);
 }
Пример #2
0
 /**
  * Creates the slot manager for the given slot
  *
  * @param  Slot        $slot
  * @return SlotManager
  */
 protected function createSlotManager(Slot $slot)
 {
     $slotName = $slot->getSlotName();
     $blocks = array();
     if (null !== $this->pageBlocks) {
         $blocks = $this->pageBlocks->getSlotBlocks($slotName);
     }
     $slotManager = new SlotManager($slot, $this->blockRepository, $this->blockManagerFactory);
     $slotManager->setUpBlockManagers($blocks);
     return $slotManager;
 }