public function toggleActivity()
    {
        if (null !== $response = $this->checkAuth(AdminResources::SALES, [], AccessManager::UPDATE)) {
            return $response;
        }

        try {
            $this->dispatch(
                TheliaEvents::SALE_TOGGLE_ACTIVITY,
                new SaleToggleActivityEvent(
                    $this->getExistingObject()
                )
            );
        } catch (\Exception $ex) {
            // Any error
            return $this->errorPage($ex);
        }

        return $this->nullResponse();
    }
public function toggleActivity()
    {
        if (null !== $response = $this->checkAuth(AdminResources::SALES, [], AccessManager::UPDATE)) {
            return $response;
        }

        try {
            $this->dispatch(
                TheliaEvents::SALE_TOGGLE_ACTIVITY,
                new SaleToggleActivityEvent(
                    $this->getExistingObject()
                )
            );
        } catch (\Exception $ex) {
            // Any error
            return $this->errorPage($ex);
        }

        return $this->nullResponse();
    }
public function toggleActivity ( ) { if ( null !== $ response = $ this -> checkAuth ( AdminResources :: SALES , [ ] , AccessManager :: UPDATE ) ) { return $ response ; } try { $ this -> dispatch ( TheliaEvents :: SALE_TOGGLE_ACTIVITY , new SaleToggleActivityEvent ( $ this -> getExistingObject ( ) ) ) ; } catch ( \ Exception $ ex ) { // Any error return $ this -> errorPage ( $ ex ) ; } return $ this -> nullResponse ( ) ; }
Toggle activity status of the sale.

@return Response
Toggle activity status of the sale .