1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class LineItemInvoiceData extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $description = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $merchantLinenumber = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $merchantPagenumber = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $nrOfItems = null;
35:
36: /**
37: * @var int|null
38: */
39: public ?int $pricePerItem = null;
40:
41: /**
42: * @return object
43: */
44: public function toObject(): object
45: {
46: $object = parent::toObject();
47: if (!is_null($this->description)) {
48: $object->description = $this->description;
49: }
50: if (!is_null($this->merchantLinenumber)) {
51: $object->merchantLinenumber = $this->merchantLinenumber;
52: }
53: if (!is_null($this->merchantPagenumber)) {
54: $object->merchantPagenumber = $this->merchantPagenumber;
55: }
56: if (!is_null($this->nrOfItems)) {
57: $object->nrOfItems = $this->nrOfItems;
58: }
59: if (!is_null($this->pricePerItem)) {
60: $object->pricePerItem = $this->pricePerItem;
61: }
62: return $object;
63: }
64:
65: /**
66: * @param object $object
67: *
68: * @return $this
69: * @throws UnexpectedValueException
70: */
71: public function fromObject(object $object): LineItemInvoiceData
72: {
73: parent::fromObject($object);
74: if (property_exists($object, 'description')) {
75: $this->description = $object->description;
76: }
77: if (property_exists($object, 'merchantLinenumber')) {
78: $this->merchantLinenumber = $object->merchantLinenumber;
79: }
80: if (property_exists($object, 'merchantPagenumber')) {
81: $this->merchantPagenumber = $object->merchantPagenumber;
82: }
83: if (property_exists($object, 'nrOfItems')) {
84: $this->nrOfItems = $object->nrOfItems;
85: }
86: if (property_exists($object, 'pricePerItem')) {
87: $this->pricePerItem = $object->pricePerItem;
88: }
89: return $this;
90: }
91: }
92: