/**
  * @param int    $id
  * @param string $eventName
  * @param string $callbackUrl
  * @param string $fallbackEmail
  * @param bool   $isActive
  * @return bool
  */
 public function update($id, $eventName = null, $callbackUrl = null, $fallbackEmail = null, $isActive = null)
 {
     $data = new SubscriptionUpdateTransfer();
     if (null !== $eventName) {
         $data->event_name = $eventName;
     }
     if (null !== $callbackUrl) {
         $data->callback_url = $callbackUrl;
     }
     if (null !== $fallbackEmail) {
         $data->fallback_email = $fallbackEmail;
     }
     if (null !== $isActive) {
         $data->is_active = (bool) $isActive;
     }
     $endpoint = new Update($this->getTransport());
     $endpoint->setId($id);
     $endpoint->setTransfer($data);
     try {
         $result = $endpoint->performRequest();
     } catch (ResourceNotFoundException $e) {
         return false;
     }
     return $result['status'] == 204;
 }
Beispiel #2
0
 /**
  * @expectedException \Hitmeister\Component\Api\Exceptions\RuntimeException
  * @expectedExceptionMessage Required params id is not set
  */
 public function testExceptionOnEmptyId()
 {
     $update = new Update($this->transport);
     $update->getURI();
 }