public function remove($idBlock, BlockManagersCollection $blockManagersCollection)
    {
        $blockManagerInfo = $blockManagersCollection->getManagerInfoByBlockId($idBlock);
        $blockManager = $blockManagerInfo['manager'];
        // @codeCoverageIgnoreStart
        if (null === $blockManager) {
            return null;
        }
        // @codeCoverageIgnoreEnd

        try {
            $this->blockRepository->startTransaction();

            // Adjust the blocks position
            $parts = $blockManagersCollection->removeAt($blockManagerInfo["index"]);
            $result = $this->adjustPosition('del', $parts["right"]);
            if (false !== $result) {
                $result = $blockManager->delete();
            }

            if (false !== $result) {
                $this->blockRepository->commit();

                return $result;
            }

            $this->blockRepository->rollBack();

            return $result;
        } catch (\Exception $e) { echo $e->getMessage();
            $this->blockRepository->rollBack();

            throw $e;
        }
    }
public function remove($idBlock, BlockManagersCollection $blockManagersCollection)
    {
        $blockManagerInfo = $blockManagersCollection->getManagerInfoByBlockId($idBlock);
        $blockManager = $blockManagerInfo['manager'];
        // @codeCoverageIgnoreStart
        if (null === $blockManager) {
            return null;
        }
        // @codeCoverageIgnoreEnd

        try {
            $this->blockRepository->startTransaction();

            // Adjust the blocks position
            $parts = $blockManagersCollection->removeAt($blockManagerInfo["index"]);
            $result = $this->adjustPosition('del', $parts["right"]);
            if (false !== $result) {
                $result = $blockManager->delete();
            }

            if (false !== $result) {
                $this->blockRepository->commit();

                return $result;
            }

            $this->blockRepository->rollBack();

            return $result;
        } catch (\Exception $e) { echo $e->getMessage();
            $this->blockRepository->rollBack();

            throw $e;
        }
    }
public function remove ( $ idBlock , BlockManagersCollection $ blockManagersCollection ) { $ blockManagerInfo = $ blockManagersCollection -> getManagerInfoByBlockId ( $ idBlock ) ; $ blockManager = $ blockManagerInfo [ 'manager' ] ; // @codeCoverageIgnoreStart if ( null === $ blockManager ) { return null ; } // @codeCoverageIgnoreEnd try { $ this -> blockRepository -> startTransaction ( ) ; // Adjust the blocks position $ parts = $ blockManagersCollection -> removeAt ( $ blockManagerInfo [ "index" ] ) ; $ result = $ this -> adjustPosition ( 'del' , $ parts [ "right" ] ) ; if ( false !== $ result ) { $ result = $ blockManager -> delete ( ) ; } if ( false !== $ result ) { $ this -> blockRepository -> commit ( ) ; return $ result ; } $ this -> blockRepository -> rollBack ( ) ; return $ result ; } catch ( \ Exception $ e ) { echo $ e -> getMessage ( ) ; $ this -> blockRepository -> rollBack ( ) ; throw $ e ; } }
Removes the block manager that handles the given block id

@param  int                     $idBlock
@param  BlockManagersCollection $blockManagersCollection
@throws \Exception
@return null|boolean
Removes the block manager that handles the given block id