/** * 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); }
/** * 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; }