コード例 #1
0
 /**
  * Get the data from the client with the filter
  *
  * An array of columns can be passed in to limit the columns that are returned
  *
  * @param array $columns
  *
  * @return \Spinen\ConnectWise\Library\Support\Collection
  */
 public function get(array $columns = [])
 {
     if (!empty($columns)) {
         $this->filter->set('ReturnFields', $columns);
     }
     return $this->client->execute($this->filter->getFilter(), $columns);
 }
コード例 #2
0
 /**
  * @test
  */
 public function it_returns_the_soap_options()
 {
     $expected = ['key 1' => 'value'];
     $client = new Client($this->buildConfig(['soap_options' => $expected]));
     $this->assertEquals($expected, $client->getSoapOptions());
 }
コード例 #3
0
 /**
  * Builds the url from the known variables of the client & and the passed in id.
  *
  * @param string $format
  * @param int    $id
  *
  * @return string
  */
 private function buildUrl($format, $id)
 {
     $this->validator->validateIntegerProperty('Id', $id);
     $company = urlencode($this->client->get('config')['connectwise']['company']);
     return sprintf($format, $this->client->getHost(), $id, $company);
 }