public function remove()
 {
     try {
         $response = $this->platform->delete('/restapi/v1.0/subscription/' . $this->subscription['id']);
         $this->unsubscribe();
         $this->dispatch(self::EVENT_REMOVE_SUCCESS, new SuccessEvent($response));
         return $response;
     } catch (Exception $e) {
         $this->unsubscribe();
         $this->dispatch(self::EVENT_REMOVE_ERROR, new ErrorEvent($e));
         throw $e;
     }
 }
Ejemplo n.º 2
0
 function remove()
 {
     if (!$this->subscribed()) {
         throw new Exception('No subscription');
     }
     try {
         $response = $this->_platform->delete('/restapi/v1.0/subscription/' . $this->_subscription['id']);
         $this->reset();
         $this->dispatch(self::EVENT_REMOVE_SUCCESS, new SuccessEvent($response));
         return $response;
     } catch (Exception $e) {
         $this->reset();
         $this->dispatch(self::EVENT_REMOVE_ERROR, new ErrorEvent($e));
         throw $e;
     }
 }