src/Controller/MelisCoreGdprController.php
public function melisCoreGdprDeleteSelectedAction()
    {
        $request = $this->getRequest();
        $success = 0;

        if ($request->isPost()) {
            $idsToBeDeleted = get_object_vars($request->getPost());

            $melisCoreGdprService = $this->getServiceLocator()->get('MelisCoreGdprService');
            $finalData = $melisCoreGdprService->deleteSelected($idsToBeDeleted);
            $success = 1;

            foreach ($finalData as $key => $value) {
                if (!$value) {
                    $success = 0;
                }
            }
        }

        return new JsonModel ([
            'success' =>  $success,
        ]);
    }
public function melisCoreGdprDeleteSelectedAction()
    {
        $request = $this->getRequest();
        $success = 0;

        if ($request->isPost()) {
            $idsToBeDeleted = get_object_vars($request->getPost());

            $melisCoreGdprService = $this->getServiceLocator()->get('MelisCoreGdprService');
            $finalData = $melisCoreGdprService->deleteSelected($idsToBeDeleted);
            $success = 1;

            foreach ($finalData as $key => $value) {
                if (!$value) {
                    $success = 0;
                }
            }
        }

        return new JsonModel ([
            'success' =>  $success,
        ]);
    }
public function melisCoreGdprDeleteSelectedAction ( ) { $ request = $ this -> getRequest ( ) ; $ success = 0 ; if ( $ request -> isPost ( ) ) { $ idsToBeDeleted = get_object_vars ( $ request -> getPost ( ) ) ; $ melisCoreGdprService = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreGdprService' ) ; $ finalData = $ melisCoreGdprService -> deleteSelected ( $ idsToBeDeleted ) ; $ success = 1 ; foreach ( $ finalData as $ key => $ value ) { if ( ! $ value ) { $ success = 0 ; } } } return new JsonModel ( [ 'success' => $ success , ] ) ; }
This will delete the data based on the selected ids
@return JsonModel
This will delete the data based on the selected ids