1: <?php
2: namespace Datadepo\Api\Structures;
3:
4: /**
5: * @property-read integer $primary
6: * @property-read integer $dataDepoId
7: * @property-read bool $deleted
8: * @property-read string $project
9: * @property-read string $idName
10: * @property-read string $name
11: * @property-read double $rabat
12: * @property-read string $invoiceCompany
13: * @property-read string $invoiceStreet
14: * @property-read string $invoiceCity
15: * @property-read string $invoiceZipCode
16: * @property-read string $invoiceIco
17: * @property-read string $invoiceDic
18: * @property-read bool $isVatPayer
19: * @property-read string $note
20: * @property-read SupplierPersonLine[] $persons
21: * @property-read SupplierBankAccountLine[] $bankAccounts
22: */
23: class SupplierLine extends AbstractStructure
24: {
25:
26: /** @var SupplierPersonLine[] */
27: private $_persons;
28:
29: /** @var SupplierBankAccountLine[] */
30: private $_bankAccounts;
31:
32: /**
33: * @return integer
34: */
35: public function getPrimary()
36: {
37: return $this->getDataDepoId();
38: }
39:
40: /**
41: * @return integer
42: */
43: public function getDataDepoId()
44: {
45: return $this->data->id;
46: }
47:
48: /**
49: * @return bool
50: */
51: public function getDeleted()
52: {
53: return (bool)$this->data->deleted;
54: }
55:
56: /**
57: * @return string
58: */
59: public function getProject()
60: {
61: return $this->data->project;
62: }
63:
64: /**
65: * @return string
66: */
67: public function getName()
68: {
69: return $this->data->name;
70: }
71:
72: /**
73: * @return string
74: */
75: public function getIdName()
76: {
77: return $this->data->idName;
78: }
79:
80: /**
81: * This column has only information character, do not calculate your prices using this column
82: * @return double
83: */
84: public function getRabat()
85: {
86: return $this->data->rabat;
87: }
88:
89: /**
90: * @return string
91: */
92: public function getInvoiceCompany()
93: {
94: return $this->data->invoiceCompany;
95: }
96:
97: /**
98: * @return string
99: */
100: public function getInvoiceStreet()
101: {
102: return $this->data->invoiceStreet;
103: }
104:
105: /**
106: * @return string
107: */
108: public function getInvoiceCity()
109: {
110: return $this->data->invoiceCity;
111: }
112:
113: /**
114: * @return string
115: */
116: public function getInvoiceZipCode()
117: {
118: return $this->data->invoiceZipCode;
119: }
120:
121: /**
122: * @return string
123: */
124: public function getInvoiceIco()
125: {
126: return $this->data->invoiceIco;
127: }
128:
129: /**
130: * @return string
131: */
132: public function getInvoiceDic()
133: {
134: return $this->data->invoiceDic;
135: }
136:
137: /**
138: * @return bool
139: */
140: public function getIsVatPayer()
141: {
142: return (bool)$this->data->invoiceVat;
143: }
144:
145: /**
146: * @return string
147: */
148: public function getNote()
149: {
150: return $this->data->note;
151: }
152:
153: /**
154: * @return SupplierPersonLine[]
155: */
156: public function getPersons()
157: {
158: if ($this->_persons === NULL) {
159: $this->_persons = array();
160: foreach ($this->data->persons as $inId => $data) {
161: $this->_persons[$inId] = new SupplierPersonLine($data, $inId);
162: }
163: }
164: return $this->_persons;
165: }
166:
167: /**
168: * @return SupplierBankAccountLine[]
169: */
170: public function getBankAccounts()
171: {
172: if ($this->_bankAccounts === NULL) {
173: $this->_bankAccounts = array();
174: foreach ($this->data->bankAccounts as $inId => $data) {
175: $this->_bankAccounts[$inId] = new SupplierBankAccountLine($data, $inId);
176: }
177: }
178: return $this->_bankAccounts;
179: }
180:
181:
182: }