-
Notifications
You must be signed in to change notification settings - Fork 1
Conditions do not appear to be working #8
Comments
So, we don't use it like that. I will need to do some digging into the code & get you an answer. We use it chained (fluent)... Psy Shell v0.7.2 (PHP 7.0.7 — cli) by Justin Hileman
>>> $config = ['connectwise' => config()['services']['connectwise']]
=> [
"connectwise" => [
"host" => "REMOVED",
"company" => "REMOVED",
"username" => "REMOVED",
"password" => "REMOVED!",
],
]
>>> $client = new Spinen\ConnectWise\Client\Client($config);
=> Spinen\ConnectWise\Client\Client {#6768}
>>> $client->contactApiFindContacts()->get()->count();
=> 1998
>>> $client->contactApiFindContacts()->whereCompanyIdEquals(250)->get()->count();
=> 37
>>> $client->contactApiFindContacts()->whereCompanyIdEquals(250)->orWhereCompanyIdEquals(19303)->get()->count();
=> 84
>>> $client->contactApiFindContacts()->whereCompanyIdGreaterThan(250)->get()->count();
=> 1945 As you can see, we are pulling the configs from the Laravel config helper, and then making a new client. Also, this repo is really about the generator, which you probably don't need. The SPINEN's ConnectWise PHP Client is really the one that you probably want to be using. I will dig into the code in the ned few days look into passing the filter in the constructor as you are doing it. Sorry that there is not more documentation on the client. Good luck & let us know if we can help! |
Ok, then I was trying to use it incorrectly. Could we please get some examples of usage for scenerios such as (searching for something, opening specific items like a specific contact, updating/adding an item)? Any help you can provide is greatly appreciated. Thanks, |
It is kind of hard to use it correctly when there is no docs!!! I will see what we can get done to better document it on the client repo. I made an issue for it here... spinen/connectwise-php-client#1 Thanks! |
When attempting to find an entity (Company, Contact, Configuration,etc...) conditions appear to be being ignored.
$client = new Spinen\ConnectWise\Client\Client($config); $contacts = $client->contactApiFindContacts(['where' => 'CompanyId = 250']); $contactsreturn = $client->execute();
This returns ALL contacts and ignores the condition.
The text was updated successfully, but these errors were encountered: