CommodityClassification   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A xmlSerialize() 0 9 1
A getItemClassificationCode() 0 2 1
A setItemClassificationCode() 0 3 1
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