CommodityClassification::xmlSerialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
nc 1
nop 1
dl 0
loc 9
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 CommodityClassification extends BaseComponent {
16
17
    protected $ItemClassificationCode;
18
    protected $validations = ['ItemClassificationCode'];
19
20
    function xmlSerialize(Writer $writer) {
21
        $this->validate();
22
        $writer->write([
23
            'name'          => SchemaNS::CBC . 'ItemClassificationCode',
24
            'value'         => $this->ItemClassificationCode,
25
            'attributes'    => [
26
                'listID'            => 'UNSPSC',
27
                'listAgencyName'    => 'GS1 US',
28
                'listName'          => 'Item Classification'
29
            ]
30
        ]);
31
    }
32
33
    public function getItemClassificationCode() {
34
        return $this->ItemClassificationCode;
35
    }
36
37
    public function setItemClassificationCode($ItemClassificationCode) {
38
        $this->ItemClassificationCode = $ItemClassificationCode;
39
        return $this;
40
    }
41
42
}
43