From 8add305f945a8ef42d84ed60ed2cb2bb08c1600f Mon Sep 17 00:00:00 2001 From: Michael Blijleven Date: Wed, 30 Dec 2015 23:08:07 +0100 Subject: [PATCH] Add findWithSelect function In some cases when trying to access certain records like a purchase entry, a normal find() won't work because a select variable is required. The filter() function doesn't work. --- src/Picqer/Financials/Exact/Query/Findable.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Picqer/Financials/Exact/Query/Findable.php b/src/Picqer/Financials/Exact/Query/Findable.php index ff694d3b..da1d8242 100644 --- a/src/Picqer/Financials/Exact/Query/Findable.php +++ b/src/Picqer/Financials/Exact/Query/Findable.php @@ -13,6 +13,17 @@ public function find($id) } + public function findWithSelect($id, $select = '') + { + $result = $this->connection()->get($this->url, [ + '$filter' => $this->primaryKey . " eq guid'$id'", + '$select' => $select + ]); + + return new self($this->connection(), $result); + } + + public function filter($filter, $expand = '', $select = '') { $request = [