src/Sulu/Bundle/AudienceTargetingBundle/Controller/TargetGroupController.php
public function cdeleteAction(Request $request)
    {
        $idsData = $request->get('ids');
        $ids = explode(',', $idsData);

        if (!count($ids)) {
            throw new MissingParameterException('TargetGroupController', 'ids');
        }

        $targetGroups = $this->getTargetGroupRepository()->findById($ids);

        foreach ($targetGroups as $targetGroup) {
            $this->getEntityManager()->remove($targetGroup);
        }

        $this->getEntityManager()->flush();

        return $this->handleView($this->view(null, 204));
    }
public function cdeleteAction(Request $request)
    {
        $idsData = $request->get('ids');
        $ids = explode(',', $idsData);

        if (!count($ids)) {
            throw new MissingParameterException('TargetGroupController', 'ids');
        }

        $targetGroups = $this->getTargetGroupRepository()->findById($ids);

        foreach ($targetGroups as $targetGroup) {
            $this->getEntityManager()->remove($targetGroup);
        }

        $this->getEntityManager()->flush();

        return $this->handleView($this->view(null, 204));
    }
public function cdeleteAction ( Request $ request ) { $ idsData = $ request -> get ( 'ids' ) ; $ ids = explode ( ',' , $ idsData ) ; if ( ! count ( $ ids ) ) { throw new MissingParameterException ( 'TargetGroupController' , 'ids' ) ; } $ targetGroups = $ this -> getTargetGroupRepository ( ) -> findById ( $ ids ) ; foreach ( $ targetGroups as $ targetGroup ) { $ this -> getEntityManager ( ) -> remove ( $ targetGroup ) ; } $ this -> getEntityManager ( ) -> flush ( ) ; return $ this -> handleView ( $ this -> view ( null , 204 ) ) ; }
Handle multiple delete requests for target groups.

@param Request $request

@throws MissingParameterException

@return Response
Handle multiple delete requests for target groups .