コード例 #1
0
 /**
  * @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;
 }
コード例 #2
0
ファイル: UpdateTest.php プロジェクト: hitmeister/api-sdk-php
 /**
  * @expectedException \Hitmeister\Component\Api\Exceptions\RuntimeException
  * @expectedExceptionMessage Required params id is not set
  */
 public function testExceptionOnEmptyId()
 {
     $update = new Update($this->transport);
     $update->getURI();
 }