Exemplo n.º 1
0
 /**
  *
  */
 public function testAttachments()
 {
     //
     $ot = $this->getOnTimeObjectOk();
     $resultT1 = $ot->attachments();
     $this->assertTrue(is_array($resultT1) && isset($resultT1['error']));
     //
     $ot = $this->getOnTimeObjectOk();
     $filterT2 = new Attachments();
     $filterT2->setId(75);
     $resultT2 = $ot->attachments($filterT2);
     $this->assertTrue(is_array($resultT2['data']));
 }
Exemplo n.º 2
0
 /**
  * @param  null|AttachmentsFilter $data
  * @return null|void
  */
 public function attachments($data = null)
 {
     $action = 'attachments';
     $postMainParameters = null;
     if ($data instanceof AttachmentsFilter) {
         $this->addMainParameter($data->getId());
         $this->addSecondaryParameter('format', $data->getFormat());
         $this->addSecondaryParameter('max_width', $data->getMaxWidth());
         $this->addSecondaryParameter('max_height', $data->getMaxHeight());
     } elseif (is_int($data)) {
         $this->addMainParameter($data);
     }
     $response = $this->call($action, $postMainParameters);
     $result = $this->handleResponse($response);
     return $result;
 }