Inheritance: extends Doctrine\ORM\EntityRepository
 /**
  * @param CopyContentBlocksToOtherLocale $copyContentBlocksToOtherLocale
  *
  * @return ContentBlock
  */
 public function handle(CopyContentBlocksToOtherLocale $copyContentBlocksToOtherLocale)
 {
     $fromLocaleContentBlocks = (array) $this->contentBlockRepository->findBy(['locale' => $copyContentBlocksToOtherLocale->fromLocale, 'status' => ContentBlockStatus::active()]);
     $id = $this->contentBlockRepository->getNextIdForLanguage($copyContentBlocksToOtherLocale->toLocale);
     array_map(function (ContentBlock $contentBlock) use($copyContentBlocksToOtherLocale, &$id) {
         $copyContentBlocksToOtherLocale->extraIdMap[$contentBlock->getExtraId()] = $this->getNewExtraId();
         $otherLocaleContentBlock = ContentBlock::create($id++, $contentBlock->getUserId(), $copyContentBlocksToOtherLocale->extraIdMap[$contentBlock->getExtraId()], $copyContentBlocksToOtherLocale->toLocale, $contentBlock->getTitle(), $contentBlock->getText(), $contentBlock->isHidden(), $contentBlock->getTemplate());
         $this->contentBlockRepository->add($otherLocaleContentBlock);
     }, $fromLocaleContentBlocks);
 }
 /**
  * @param UpdateContentBlock $updateContentBlock
  *
  * @return ContentBlock
  */
 public function handle(UpdateContentBlock $updateContentBlock)
 {
     $updateContentBlock->contentBlock = $updateContentBlock->contentBlock->update($updateContentBlock->title, $updateContentBlock->text, !$updateContentBlock->isVisible, $updateContentBlock->template);
     $this->contentBlockRepository->add($updateContentBlock->contentBlock);
 }
 /**
  * @param DeleteContentBlock $deleteContentBlock
  *
  * @return ContentBlock
  */
 public function handle(DeleteContentBlock $deleteContentBlock)
 {
     $this->contentBlockRepository->removeByIdAndLocale($deleteContentBlock->contentBlock->getId(), $deleteContentBlock->contentBlock->getLocale());
     Model::deleteExtraById($deleteContentBlock->contentBlock->getExtraId());
 }
 /**
  * @param CreateContentBlock $createContentBlock
  *
  * @return ContentBlock
  */
 public function handle(CreateContentBlock $createContentBlock)
 {
     $createContentBlock->contentBlock = ContentBlock::create($this->contentBlockRepository->getNextIdForLanguage($createContentBlock->language), $createContentBlock->userId, $this->getNewExtraId(), $createContentBlock->language, $createContentBlock->title, $createContentBlock->text, !$createContentBlock->isVisible, $createContentBlock->template);
     $this->contentBlockRepository->add($createContentBlock->contentBlock);
 }