/** * 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); }
/** * @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()); }
/** * 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); }