public function remove($sourceDir, array $options, $username)
    {
        $dir = $this
            ->init($sourceDir, $options, $username)
            ->getDirInUse();

        $blockName = $options["blockname"];
        $blocksDir = $dir . '/blocks';
        $filename = sprintf('%s/%s.json', $blocksDir, $blockName);
        $options["block"] = JsonTools::jsonDecode(FilesystemTools::readFile($filename));
        Dispatcher::dispatch(BlockEvents::BLOCK_REMOVING, new BlockRemovingEvent($this->serializer, $filename));

        $this->filesystem->remove($filename);
        $this->removeBlockFromSlotFile($options, $dir);

        Dispatcher::dispatch(BlockEvents::BLOCK_REMOVED, new BlockRemovedEvent($this->serializer, $filename));
        DataLogger::log(
            sprintf(
                'Block "%s" has been removed from the "%s" slot on page "%s" for the "%s_%s" language',
                $options["blockname"],
                $options["slot"],
                $options["page"],
                $options["language"],
                $options["country"]
            )
        );
    }
public function remove($sourceDir, array $options, $username)
    {
        $dir = $this
            ->init($sourceDir, $options, $username)
            ->getDirInUse();

        $blockName = $options["blockname"];
        $blocksDir = $dir . '/blocks';
        $filename = sprintf('%s/%s.json', $blocksDir, $blockName);
        $options["block"] = JsonTools::jsonDecode(FilesystemTools::readFile($filename));
        Dispatcher::dispatch(BlockEvents::BLOCK_REMOVING, new BlockRemovingEvent($this->serializer, $filename));

        $this->filesystem->remove($filename);
        $this->removeBlockFromSlotFile($options, $dir);

        Dispatcher::dispatch(BlockEvents::BLOCK_REMOVED, new BlockRemovedEvent($this->serializer, $filename));
        DataLogger::log(
            sprintf(
                'Block "%s" has been removed from the "%s" slot on page "%s" for the "%s_%s" language',
                $options["blockname"],
                $options["slot"],
                $options["page"],
                $options["language"],
                $options["country"]
            )
        );
    }
public function remove ( $ sourceDir , array $ options , $ username ) { $ dir = $ this -> init ( $ sourceDir , $ options , $ username ) -> getDirInUse ( ) ; $ blockName = $ options [ "blockname" ] ; $ blocksDir = $ dir . '/blocks' ; $ filename = sprintf ( '%s/%s.json' , $ blocksDir , $ blockName ) ; $ options [ "block" ] = JsonTools :: jsonDecode ( FilesystemTools :: readFile ( $ filename ) ) ; Dispatcher :: dispatch ( BlockEvents :: BLOCK_REMOVING , new BlockRemovingEvent ( $ this -> serializer , $ filename ) ) ; $ this -> filesystem -> remove ( $ filename ) ; $ this -> removeBlockFromSlotFile ( $ options , $ dir ) ; Dispatcher :: dispatch ( BlockEvents :: BLOCK_REMOVED , new BlockRemovedEvent ( $ this -> serializer , $ filename ) ) ; DataLogger :: log ( sprintf ( 'Block "%s" has been removed from the "%s" slot on page "%s" for the "%s_%s" language' , $ options [ "blockname" ] , $ options [ "slot" ] , $ options [ "page" ] , $ options [ "language" ] , $ options [ "country" ] ) ) ; }
Removes the block from the given slot

@param $sourceDir
@param array $options
@param $username
Removes the block from the given slot