Exemple #1
0
 /**
  * Get data
  *
  * @return array
  */
 public function getData()
 {
     if (isset($this->loadedData)) {
         return $this->loadedData;
     }
     $items = $this->collection->getItems();
     /** @var \Magento\Cms\Model\Block $block */
     foreach ($items as $block) {
         $this->loadedData[$block->getId()] = $block->getData();
     }
     return $this->loadedData;
 }
 /**
  * Get data
  *
  * @return array
  */
 public function getData()
 {
     if (isset($this->loadedData)) {
         return $this->loadedData;
     }
     $items = $this->collection->getItems();
     /** @var \Magento\Cms\Model\Block $block */
     foreach ($items as $block) {
         $this->loadedData[$block->getId()] = $block->getData();
     }
     $data = $this->dataPersistor->get('cms_block');
     if (!empty($data)) {
         $block = $this->collection->getNewEmptyItem();
         $block->setData($data);
         $this->loadedData[$block->getId()] = $block->getData();
     }
     return $this->loadedData;
 }