/**
  * @param \Symfony\Component\Form\FormInterface $blockForm
  * @param int $idCmsBlock
  * @param bool $encode
  *
  * @return void
  */
 public function handleLocalizedCollectionForm(FormInterface $blockForm, $idCmsBlock, $encode = true)
 {
     $blockTransfer = new BlockTransfer();
     $blockTransfer->setIdCmsBlock($idCmsBlock);
     $blockData = $blockForm->getData();
     $localizedBlockData = $blockData[LocalizedBlockCollectionForm::FIELD_LOCALIZED_BLOCKS];
     foreach ($localizedBlockData as $localeName => $localizedBlock) {
         $localizedValues = $localizedBlock[LocalizedBlockForm::FIELD_VALUES];
         if (!$encode) {
             $localizedValues = json_decode($localizedValues, true);
         }
         $localizedValues = json_encode($localizedValues);
         $locale = $this->createLocale($localeName, $localizedBlock);
         $localizedBlockTransfer = new BlockLocalizedTransfer();
         $localizedBlockTransfer->setFkCmsBlock($idCmsBlock);
         $localizedBlockTransfer->setValues($localizedValues);
         $localizedBlockTransfer->setLocale($locale);
         $blockTransfer->addLocalizedBlocks($localizedBlockTransfer);
     }
     $this->cmsBlockFacade->createOrUpdateLocalizedBlocks($blockTransfer);
 }
 /**
  * @param int $idCmsBlock
  *
  * @return array
  */
 public function getOptions($idCmsBlock)
 {
     return [ValueSchemaForm::OPTION_VALUE_SCHEMA => json_decode($this->blockFacade->getSchemaByIdBlock($idCmsBlock), true)];
 }