diff --git a/src/Picqer/Financials/Exact/Query/Findable.php b/src/Picqer/Financials/Exact/Query/Findable.php index 748dd6d6..f75c52a3 100644 --- a/src/Picqer/Financials/Exact/Query/Findable.php +++ b/src/Picqer/Financials/Exact/Query/Findable.php @@ -122,9 +122,20 @@ public function filter($filter, $expand = '', $select = '', $system_query_option * * @return \Picqer\Financials\Exact\Model|null */ - public function first() + public function first($filter = '', $expand = '', $select = '', $system_query_options = null, array $headers = []) { - $results = $this->filter('', '', '', ['$top'=> 1]); + $query_options = [ + '$top'=> 1, + ]; + + if (is_array($system_query_options)) { + // Remove this option, we only want 1 record + unset($system_query_options['$top']); + + $query_options = array_merge($query_options, $system_query_options); + } + + $results = $this->filter($filter, $expand, $select, $query_options, $headers); $result = is_array($results) && count($results) > 0 ? $results[0] : null; return $result;