protected function deleteBlocks()
    {
        $blocks = $this->blockRepository->retrieveContentsBySlotName($this->slot->getSlotName());
        if (count($blocks) <= 0) {
            return null;
        }
        try {
            $result = null;

            $this->blockRepository->startTransaction();
            foreach ($blocks as $block) {
                $result = $this->blockRepository
                            ->setRepositoryObject($block)
                            ->delete();

                if(!$result) break;
            }

            if ($result) {
                $this->blockRepository->commit();
            } else {
                $this->blockRepository->rollBack();
            }

            return $result;
        } catch (\Exception $e) {
            if (isset($this->blockRepository) && $this->blockRepository !== null) {
                $this->blockRepository->rollBack();
            }

            throw $e;
        }
    }