コード例 #1
0
 /**
  * @param int   $id
  * @param array $embedded
  * @return UnitWithEmbeddedTransfer|null
  */
 public function get($id, array $embedded = [])
 {
     $endpoint = new Get($this->getTransport());
     // Ask for embedded fields
     if (!empty($embedded)) {
         $endpoint->setParams(['embedded' => $embedded]);
     }
     $result = $this->performWithId($endpoint, $id);
     return $result ? UnitWithEmbeddedTransfer::make($result) : null;
 }
コード例 #2
0
ファイル: GetTest.php プロジェクト: hitmeister/api-sdk-php
 /**
  * @expectedException \Hitmeister\Component\Api\Exceptions\RuntimeException
  * @expectedExceptionMessage Required params id is not set
  */
 public function testExceptionOnEmptyId()
 {
     $get = new Get($this->transport);
     $get->getURI();
 }