public function setToggleVisibilityAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) {
            return $response;
        }

        $event = new CategoryToggleVisibilityEvent($this->getExistingObject());

        try {
            $this->dispatch(TheliaEvents::CATEGORY_TOGGLE_VISIBILITY, $event);
        } catch (\Exception $ex) {
            // Any error
            return $this->errorPage($ex);
        }

        // Ajax response -> no action
        return $this->nullResponse();
    }
public function setToggleVisibilityAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth($this->resourceCode, array(), AccessManager::UPDATE)) {
            return $response;
        }

        $event = new CategoryToggleVisibilityEvent($this->getExistingObject());

        try {
            $this->dispatch(TheliaEvents::CATEGORY_TOGGLE_VISIBILITY, $event);
        } catch (\Exception $ex) {
            // Any error
            return $this->errorPage($ex);
        }

        // Ajax response -> no action
        return $this->nullResponse();
    }
public function setToggleVisibilityAction ( ) { // Check current user authorization if ( null !== $ response = $ this -> checkAuth ( $ this -> resourceCode , array ( ) , AccessManager :: UPDATE ) ) { return $ response ; } $ event = new CategoryToggleVisibilityEvent ( $ this -> getExistingObject ( ) ) ; try { $ this -> dispatch ( TheliaEvents :: CATEGORY_TOGGLE_VISIBILITY , $ event ) ; } catch ( \ Exception $ ex ) { // Any error return $ this -> errorPage ( $ ex ) ; } // Ajax response -> no action return $ this -> nullResponse ( ) ; }
Online status toggle category
Online status toggle category