public function clear(BlockManagersCollection $blockManagersCollection)
    {
        // @codeCoverageIgnoreStart
        if ($blockManagersCollection->count() == 0) {
            return null;
        }
        // @codeCoverageIgnoreEnd

        try {
            $result = null;
            $this->blockRepository->startTransaction();
            $blockManagers = $blockManagersCollection->getBlockManagers();

            foreach ($blockManagers as $blockManager) {
                $result = $blockManager->delete();
                if (false === $result) {
                    break;
                }
            }

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

                return $result;
            }

            $this->blockRepository->rollBack();

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

            throw $e;
        }
    }
public function clear(BlockManagersCollection $blockManagersCollection)
    {
        // @codeCoverageIgnoreStart
        if ($blockManagersCollection->count() == 0) {
            return null;
        }
        // @codeCoverageIgnoreEnd

        try {
            $result = null;
            $this->blockRepository->startTransaction();
            $blockManagers = $blockManagersCollection->getBlockManagers();

            foreach ($blockManagers as $blockManager) {
                $result = $blockManager->delete();
                if (false === $result) {
                    break;
                }
            }

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

                return $result;
            }

            $this->blockRepository->rollBack();

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

            throw $e;
        }
    }
public function clear ( BlockManagersCollection $ blockManagersCollection ) { // @codeCoverageIgnoreStart if ( $ blockManagersCollection -> count ( ) == 0 ) { return null ; } // @codeCoverageIgnoreEnd try { $ result = null ; $ this -> blockRepository -> startTransaction ( ) ; $ blockManagers = $ blockManagersCollection -> getBlockManagers ( ) ; foreach ( $ blockManagers as $ blockManager ) { $ result = $ blockManager -> delete ( ) ; if ( false === $ result ) { break ; } } if ( false !== $ result ) { $ this -> blockRepository -> commit ( ) ; $ blockManagersCollection -> clear ( ) ; return $ result ; } $ this -> blockRepository -> rollBack ( ) ; return $ result ; } catch ( \ Exception $ e ) { $ this -> blockRepository -> rollBack ( ) ; throw $ e ; } }
Deletes all the blocks managed by the slot

@param  BlockManagersCollection $blockManagersCollection
@throws \Exception
@return boolean

@api
Deletes all the blocks managed by the slot