File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ $client = $api->contact();
63
63
64
64
// filters
65
65
$client->size = 100;
66
+ $client->email = 'john.doe@example.com';
67
+ $client->name = 'John Doe';
66
68
$client->number = 123456;
67
69
$client->customer = true;
68
70
$client->vendor = false;
@@ -279,4 +281,4 @@ $response = $client->getPage(0);
279
281
// can be possible null because the response body can be empty
280
282
$json = \Sysix\LexOffice\Utils::getJsonFromResponse($response); // as object
281
283
$json = \Sysix\LexOffice\Utils::getJsonFromResponse($response, true); // as associative array
282
- ```
284
+ ```
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ class Contact extends PaginationClient
17
17
18
18
protected string $ resource = 'contacts ' ;
19
19
20
+ public ?string $ email = null ;
21
+
22
+ public ?string $ name = null ;
23
+
20
24
public ?int $ number = null ;
21
25
22
26
public ?bool $ customer = null ;
@@ -25,6 +29,8 @@ class Contact extends PaginationClient
25
29
26
30
protected function buildQueryParams (array $ params ): string
27
31
{
32
+ $ params ['email ' ] = $ this ->email ;
33
+ $ params ['name ' ] = $ this ->name ;
28
34
$ params ['number ' ] = $ this ->number ;
29
35
$ params ['customer ' ] = $ this ->customer ;
30
36
$ params ['vendor ' ] = $ this ->vendor ;
Original file line number Diff line number Diff line change @@ -29,14 +29,16 @@ public function testGetPageWithFilters(): void
29
29
{
30
30
[$ api , $ client ] = $ this ->createClientMockObject (Contact::class);
31
31
32
+ $ client ->email = 'john.doe@example.com ' ;
33
+ $ client ->name = 'John Doe ' ;
32
34
$ client ->number = 12345 ;
33
35
$ client ->customer = true ;
34
36
$ client ->vendor = false ;
35
37
36
38
$ client ->getPage (0 );
37
39
38
40
$ this ->assertEquals (
39
- $ api ->apiUrl . '/v1/contacts?page=0&number=12345&customer=1&vendor=0&size=100 ' ,
41
+ $ api ->apiUrl . '/v1/contacts?page=0&email=john.doe%40example.com&name=John+Doe& number=12345&customer=1&vendor=0&size=100 ' ,
40
42
$ api ->getRequest ()->getUri ()->__toString ()
41
43
);
42
44
}
You can’t perform that action at this time.
0 commit comments