UBLExtensions::setUBLExtensions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * MÓDULO DE EMISIÓN ELECTRÓNICA F72X
5
 * UBL 2.1
6
 * Version 1.0
7
 * 
8
 * Copyright 2019, Jaime Cruz
9
 */
10
11
namespace F72X\UblComponent;
12
13
use Sabre\Xml\Writer;
14
15
class UBLExtensions extends BaseComponent {
16
17
    /** @var UBLExtension[] */
18
    protected $UBLExtensions = [];
19
20
    public function xmlSerialize(Writer $writer) {
21
        foreach ($this->UBLExtensions as $ext) {
22
            $writer->write([
23
                SchemaNS::EXT . 'UBLExtension' => $ext
24
            ]);
25
        }
26
    }
27
28
    public function getUBLExtensions() {
29
        return $this->UBLExtensions;
30
    }
31
32
    public function setUBLExtensions($UBLExtensions) {
33
        $this->UBLExtensions = $UBLExtensions;
34
        return $this;
35
    }
36
37
    /**
38
     * 
39
     * @param UBLExtension $UBLExtension
40
     * @return $this
41
     */
42
    public function addUBLExtension($UBLExtension) {
43
        $this->UBLExtensions[] = $UBLExtension;
44
        return $this;
45
    }
46
47
}
48