/** * 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_resets_the_where_raw_chain_if_chained_does_not_pass_logical_order_by_calls() { $this->assertEquals($this->filter, $this->filter->whereRaw("condition = 'value1'")); $this->assertEquals($this->filter, $this->filter->whereRaw("condition = 'value2'")); $this->assertEquals(['Conditions' => "condition = 'value2'"], $this->filter->getFilter()); }