| Total Complexity | 6 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class Invoice extends AbstractDocument |
||
| 11 | { |
||
| 12 | 8 | public function getImportRoot(): string |
|
| 13 | { |
||
| 14 | 8 | return 'lst:invoice'; |
|
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Add link. |
||
| 19 | * |
||
| 20 | * @param Type\Dtos\LinkDto $data |
||
| 21 | * |
||
| 22 | * @return $this |
||
| 23 | */ |
||
| 24 | 1 | public function addLink(Type\Dtos\LinkDto $data): self |
|
| 25 | { |
||
| 26 | 1 | $link = new Type\Link($this->dependenciesFactory); |
|
| 27 | 1 | $link |
|
| 28 | 1 | ->setDirectionalVariable($this->useOneDirectionalVariables) |
|
| 29 | 1 | ->setResolveOptions($this->resolveOptions) |
|
| 30 | 1 | ->setData($data); |
|
| 31 | 1 | $this->data->links[] = $link; |
|
| 32 | |||
| 33 | 1 | return $this; |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Add advance payment item. |
||
| 38 | * |
||
| 39 | * @param Invoice\AdvancePaymentItemDto $data |
||
| 40 | * |
||
| 41 | * @return $this |
||
| 42 | */ |
||
| 43 | 1 | public function addAdvancePaymentItem(Invoice\AdvancePaymentItemDto $data): self |
|
| 44 | { |
||
| 45 | 1 | $invoiceDetail = new Invoice\AdvancePaymentItem($this->dependenciesFactory); |
|
| 46 | 1 | $invoiceDetail |
|
| 47 | 1 | ->setDirectionalVariable($this->useOneDirectionalVariables) |
|
| 48 | 1 | ->setResolveOptions($this->resolveOptions) |
|
| 49 | 1 | ->setData($data); |
|
| 50 | 1 | $this->data->invoiceDetail[] = $invoiceDetail; |
|
| 51 | |||
| 52 | 1 | return $this; |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | 8 | protected function getDocumentNamespace(): string |
|
| 59 | { |
||
| 60 | 8 | return 'inv'; |
|
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * {@inheritdoc} |
||
| 65 | */ |
||
| 66 | 8 | protected function getDocumentName(): string |
|
| 67 | { |
||
| 68 | 8 | return 'invoice'; |
|
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * {@inheritdoc} |
||
| 73 | */ |
||
| 74 | 8 | protected function getDefaultDto(): Common\Dtos\AbstractDto |
|
| 77 | } |
||
| 78 | } |
||
| 79 |