public function unmountDatabase(Request $request, $databox_id)
    {
        $success = false;

        try {
            $databox = $this->findDataboxById($databox_id);
            $databox->unmount_databox();

            $success = true;
        } catch (\Exception $e) {

        }

        if ('json' === $request->getRequestFormat()) {
            $msg = $success
                ? $this->app->trans('The publication has been stopped')
                : $this->app->trans('An error occured');
            return $this->app->json([
                'success' => $success,
                'msg'     => $msg,
                'sbas_id' => $databox_id
            ]);
        }

        return $this->app->redirectPath('admin_databases', [
            'reload-tree' => 1,
        ]);
    }
public function unmountDatabase(Request $request, $databox_id)
    {
        $success = false;

        try {
            $databox = $this->findDataboxById($databox_id);
            $databox->unmount_databox();

            $success = true;
        } catch (\Exception $e) {

        }

        if ('json' === $request->getRequestFormat()) {
            $msg = $success
                ? $this->app->trans('The publication has been stopped')
                : $this->app->trans('An error occured');
            return $this->app->json([
                'success' => $success,
                'msg'     => $msg,
                'sbas_id' => $databox_id
            ]);
        }

        return $this->app->redirectPath('admin_databases', [
            'reload-tree' => 1,
        ]);
    }
public function unmountDatabase ( Request $ request , $ databox_id ) { $ success = false ; try { $ databox = $ this -> findDataboxById ( $ databox_id ) ; $ databox -> unmount_databox ( ) ; $ success = true ; } catch ( \ Exception $ e ) { } if ( 'json' === $ request -> getRequestFormat ( ) ) { $ msg = $ success ? $ this -> app -> trans ( 'The publication has been stopped' ) : $ this -> app -> trans ( 'An error occured' ) ; return $ this -> app -> json ( [ 'success' => $ success , 'msg' => $ msg , 'sbas_id' => $ databox_id ] ) ; } return $ this -> app -> redirectPath ( 'admin_databases' , [ 'reload-tree' => 1 , ] ) ; }
Unmount a databox

@param  Request $request    The current HTTP request
@param  integer $databox_id The requested databox
@return JsonResponse|RedirectResponse
Unmount a databox