public function updateBlock(BlockInterface $block, $update) { if (!is_string($update)) { return; } $block->setContent($update); }
protected function getPreBlockEditContent(BlockInterface $block) { $widthKey = $block->getProviderName() == 'ibrows_newsletter.block.provider.textarea' ? 'textWidth' : 'imageWidth'; $width = $block->getParentBlock()->getProviderOption($widthKey, '50%'); return '<td class="provider" width="' . $width . '" style="width:' . $width . '">'; }
/** * @param BlockInterface $parentBlock * @param BlockInterface $cloneParentBlock */ protected function loopCloneNewsletterBlocks(BlockInterface $parentBlock, BlockInterface $cloneParentBlock) { foreach ($parentBlock->getBlocks() as $childBlock) { $cloneChildBlock = clone $childBlock; $cloneChildBlock->setBlocks(array()); $cloneParentBlock->addBlock($cloneChildBlock); $provider = $this->getBlockProviderManager()->get($cloneChildBlock->getProviderName()); $provider->updateClonedBlock($cloneChildBlock); if ($childBlock->isCompound()) { $this->loopCloneNewsletterBlocks($childBlock, $cloneChildBlock); } } }
/** * @param BlockInterface $block * @return Newsletter */ public function removeBlock(BlockInterface $block) { $block->setNewsletter(null); $this->blocks->removeElement($block); return $this; }
protected function setFilename(BlockInterface $block, $filename) { return $block->setProviderOption(self::PROVIDER_OPTION_FILENAME, $filename); }