File tree 6 files changed +60
-1
lines changed
6 files changed +60
-1
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,11 @@ $response = $api->paymentCondition()->getAll();
183
183
$response = $api->postingCategory()->getAll();
184
184
```
185
185
186
+ ### Print Layouts Endpoint
187
+ ``` php
188
+ $response = $api->printLayout()->getAll();
189
+ ```
190
+
186
191
### Profile Endpoint
187
192
``` php
188
193
$response = $api->profile()->get();
Original file line number Diff line number Diff line change 24
24
use Sysix \LexOffice \Clients \Payment ;
25
25
use Sysix \LexOffice \Clients \PaymentCondition ;
26
26
use Sysix \LexOffice \Clients \PostingCategory ;
27
+ use Sysix \LexOffice \Clients \PrintLayout ;
27
28
use Sysix \LexOffice \Clients \Profile ;
28
29
use Sysix \LexOffice \Clients \Quotation ;
29
30
use Sysix \LexOffice \Clients \RecurringTemplate ;
@@ -149,6 +150,11 @@ public function postingCategory(): PostingCategory
149
150
return new PostingCategory ($ this );
150
151
}
151
152
153
+ public function printLayout (): PrintLayout
154
+ {
155
+ return new PrintLayout ($ this );
156
+ }
157
+
152
158
public function profile (): Profile
153
159
{
154
160
return new Profile ($ this );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Sysix \LexOffice \Clients ;
6
+
7
+ use Psr \Http \Message \ResponseInterface ;
8
+ use Sysix \LexOffice \BaseClient ;
9
+
10
+ class PrintLayout extends BaseClient
11
+ {
12
+ protected string $ resource = 'print-layouts ' ;
13
+
14
+ public function getAll (): ResponseInterface
15
+ {
16
+ return $ this ->api ->newRequest ('GET ' , $ this ->resource )
17
+ ->getResponse ();
18
+ }
19
+ }
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ public static function createStream(mixed $content): StreamInterface
86
86
public static function createMultipartStream (array $ content , string $ boundary = null ): MultipartStream
87
87
{
88
88
$ stream = [];
89
- $ boundary = $ boundary ? : '--lexoffice ' ;
89
+ $ boundary = ! is_null ( $ boundary) && $ boundary !== '' ? $ boundary : '--lexoffice ' ;
90
90
91
91
foreach ($ content as $ key => $ value ) {
92
92
$ stream [] = [
Original file line number Diff line number Diff line change 19
19
use Sysix \LexOffice \Clients \Payment ;
20
20
use Sysix \LexOffice \Clients \PaymentCondition ;
21
21
use Sysix \LexOffice \Clients \PostingCategory ;
22
+ use Sysix \LexOffice \Clients \PrintLayout ;
22
23
use Sysix \LexOffice \Clients \Profile ;
23
24
use Sysix \LexOffice \Clients \Quotation ;
24
25
use Sysix \LexOffice \Clients \RecurringTemplate ;
@@ -52,6 +53,7 @@ public function testClients(): void
52
53
$ this ->assertInstanceOf (Payment::class, $ stub ->payment ());
53
54
$ this ->assertInstanceOf (PaymentCondition::class, $ stub ->paymentCondition ());
54
55
$ this ->assertInstanceOf (PostingCategory::class, $ stub ->postingCategory ());
56
+ $ this ->assertInstanceOf (PrintLayout::class, $ stub ->printLayout ());
55
57
$ this ->assertInstanceOf (Profile::class, $ stub ->profile ());
56
58
$ this ->assertInstanceOf (Quotation::class, $ stub ->quotation ());
57
59
$ this ->assertInstanceOf (RecurringTemplate::class, $ stub ->recurringTemplate ());
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Sysix \LexOffice \Tests \Clients ;
6
+
7
+ use Psr \Http \Message \ResponseInterface ;
8
+ use Sysix \LexOffice \Clients \PrintLayout ;
9
+ use Sysix \LexOffice \Tests \TestClient ;
10
+
11
+ class PrintLayoutTest extends TestClient
12
+ {
13
+ public function testGetAll (): void
14
+ {
15
+ [$ api , $ stub ] = $ this ->createClientMockObject (PrintLayout::class);
16
+
17
+ $ response = $ stub ->getAll ();
18
+
19
+ $ this ->assertInstanceOf (ResponseInterface::class, $ response );
20
+
21
+ $ this ->assertEquals ('GET ' , $ api ->getRequest ()->getMethod ());
22
+ $ this ->assertEquals (
23
+ $ api ->apiUrl . '/v1/print-layouts ' ,
24
+ $ api ->getRequest ()->getUri ()->__toString ()
25
+ );
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments