Skip to content

Commit e435e1a

Browse files
committed
Add new contact filters for email and name
It should be possible to filter by email address or / and name as described in the API. References: - https://developers.lexoffice.io/docs/#contacts-endpoint-purpose
1 parent 674a380 commit e435e1a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ $client = $api->contact();
6363

6464
// filters
6565
$client->size = 100;
66+
$client->email = 'john.doe@example.com';
67+
$client->name = 'John Doe';
6668
$client->number = 123456;
6769
$client->customer = true;
6870
$client->vendor = false;
@@ -279,4 +281,4 @@ $response = $client->getPage(0);
279281
// can be possible null because the response body can be empty
280282
$json = \Sysix\LexOffice\Utils::getJsonFromResponse($response); // as object
281283
$json = \Sysix\LexOffice\Utils::getJsonFromResponse($response, true); // as associative array
282-
```
284+
```

src/Clients/Contact.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ class Contact extends PaginationClient
1717

1818
protected string $resource = 'contacts';
1919

20+
public ?string $email = null;
21+
22+
public ?string $name = null;
23+
2024
public ?int $number = null;
2125

2226
public ?bool $customer = null;
@@ -25,6 +29,8 @@ class Contact extends PaginationClient
2529

2630
protected function buildQueryParams(array $params): string
2731
{
32+
$params['email'] = $this->email;
33+
$params['name'] = $this->name;
2834
$params['number'] = $this->number;
2935
$params['customer'] = $this->customer;
3036
$params['vendor'] = $this->vendor;

0 commit comments

Comments
 (0)