src/Controller/ToolUserController.php
public function deleteUserAction()
    {

        $response = array();
        $this->getEventManager()->trigger('meliscore_tooluser_delete_start', $this, $response);
        $translator = $this->getServiceLocator()->get('translator');
        $id = null;
        $success = 0;
        $textTitle = 'tr_meliscore_tool_user_delete';
        $textMessage = 'tr_meliscore_tool_user_delete_unable';
        $userTable = $this->getServiceLocator()->get('MelisCoreTableUser');

        if($this->getRequest()->isPost())
        {
            $id = $this->getRequest()->getPost('id');

            if(is_numeric($id))
            {
                $userTable->deleteById($id);
                $success = 1;
                $textMessage = 'tr_meliscore_tool_user_delete_success';
            }
        }

        $response = array(
            'textTitle' => $textTitle,
            'textMessage' => $textMessage,
            'success' => $success
        );
        $this->getEventManager()->trigger('meliscore_tooluser_delete_end', $this, array_merge($response, array('typeCode' => 'CORE_USER_DELETE', 'itemId' => $id)));

        return new JsonModel($response);
    }
public function deleteUserAction()
    {

        $response = array();
        $this->getEventManager()->trigger('meliscore_tooluser_delete_start', $this, $response);
        $translator = $this->getServiceLocator()->get('translator');
        $id = null;
        $success = 0;
        $textTitle = 'tr_meliscore_tool_user_delete';
        $textMessage = 'tr_meliscore_tool_user_delete_unable';
        $userTable = $this->getServiceLocator()->get('MelisCoreTableUser');

        if($this->getRequest()->isPost())
        {
            $id = $this->getRequest()->getPost('id');

            if(is_numeric($id))
            {
                $userTable->deleteById($id);
                $success = 1;
                $textMessage = 'tr_meliscore_tool_user_delete_success';
            }
        }

        $response = array(
            'textTitle' => $textTitle,
            'textMessage' => $textMessage,
            'success' => $success
        );
        $this->getEventManager()->trigger('meliscore_tooluser_delete_end', $this, array_merge($response, array('typeCode' => 'CORE_USER_DELETE', 'itemId' => $id)));

        return new JsonModel($response);
    }
public function deleteUserAction ( ) { $ response = array ( ) ; $ this -> getEventManager ( ) -> trigger ( 'meliscore_tooluser_delete_start' , $ this , $ response ) ; $ translator = $ this -> getServiceLocator ( ) -> get ( 'translator' ) ; $ id = null ; $ success = 0 ; $ textTitle = 'tr_meliscore_tool_user_delete' ; $ textMessage = 'tr_meliscore_tool_user_delete_unable' ; $ userTable = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreTableUser' ) ; if ( $ this -> getRequest ( ) -> isPost ( ) ) { $ id = $ this -> getRequest ( ) -> getPost ( 'id' ) ; if ( is_numeric ( $ id ) ) { $ userTable -> deleteById ( $ id ) ; $ success = 1 ; $ textMessage = 'tr_meliscore_tool_user_delete_success' ; } } $ response = array ( 'textTitle' => $ textTitle , 'textMessage' => $ textMessage , 'success' => $ success ) ; $ this -> getEventManager ( ) -> trigger ( 'meliscore_tooluser_delete_end' , $ this , array_merge ( $ response , array ( 'typeCode' => 'CORE_USER_DELETE' , 'itemId' => $ id ) ) ) ; return new JsonModel ( $ response ) ; }
Handles the Delete User event
@return \Zend\View\Model\JsonModel
Handles the Delete User event