1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CfdiUtils\Elements\CartaPorte20; |
4
|
|
|
|
5
|
|
|
use CfdiUtils\Elements\Common\AbstractElement; |
6
|
|
|
|
7
|
|
|
class Mercancia extends AbstractElement |
8
|
|
|
{ |
9
|
2 |
|
public function getElementName(): string |
10
|
|
|
{ |
11
|
2 |
|
return 'cartaporte20:Mercancia'; |
12
|
|
|
} |
13
|
|
|
|
14
|
2 |
|
public function getChildrenOrder(): array |
15
|
|
|
{ |
16
|
|
|
return [ |
17
|
2 |
|
'cartaporte20:Pedimentos', |
18
|
|
|
'cartaporte20:GuiasIdentificacion', |
19
|
|
|
'cartaporte20:CantidadTransporta', |
20
|
|
|
'cartaporte20:DetalleMercancia', ]; |
21
|
|
|
} |
22
|
|
|
|
23
|
1 |
|
public function addPedimentos(array $attributes = []): Pedimentos |
24
|
|
|
{ |
25
|
1 |
|
$subject = new Pedimentos($attributes); |
26
|
1 |
|
$this->addChild($subject); |
27
|
1 |
|
return $subject; |
28
|
|
|
} |
29
|
|
|
|
30
|
1 |
|
public function multiPedimentos(array ...$elementAttributes): self |
31
|
|
|
{ |
32
|
1 |
|
foreach ($elementAttributes as $attributes) { |
33
|
1 |
|
$this->addPedimentos($attributes); |
34
|
|
|
} |
35
|
1 |
|
return $this; |
36
|
|
|
} |
37
|
|
|
|
38
|
1 |
|
public function addGuiasIdentificacion(array $attributes = []): GuiasIdentificacion |
39
|
|
|
{ |
40
|
1 |
|
$subject = new GuiasIdentificacion($attributes); |
41
|
1 |
|
$this->addChild($subject); |
42
|
1 |
|
return $subject; |
43
|
|
|
} |
44
|
|
|
|
45
|
1 |
|
public function multiGuiasIdentificacion(array ...$elementAttributes): self |
46
|
|
|
{ |
47
|
1 |
|
foreach ($elementAttributes as $attributes) { |
48
|
1 |
|
$this->addGuiasIdentificacion($attributes); |
49
|
|
|
} |
50
|
1 |
|
return $this; |
51
|
|
|
} |
52
|
|
|
|
53
|
1 |
|
public function addCantidadTransporta(array $attributes = []): CantidadTransporta |
54
|
|
|
{ |
55
|
1 |
|
$subject = new CantidadTransporta($attributes); |
56
|
1 |
|
$this->addChild($subject); |
57
|
1 |
|
return $subject; |
58
|
|
|
} |
59
|
|
|
|
60
|
1 |
|
public function multiCantidadTransporta(array ...$elementAttributes): self |
61
|
|
|
{ |
62
|
1 |
|
foreach ($elementAttributes as $attributes) { |
63
|
1 |
|
$this->addCantidadTransporta($attributes); |
64
|
|
|
} |
65
|
1 |
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
1 |
|
public function getDetalleMercancia(): DetalleMercancia |
69
|
|
|
{ |
70
|
1 |
|
return $this->helperGetOrAdd(new DetalleMercancia()); |
|
|
|
|
71
|
|
|
} |
72
|
|
|
|
73
|
1 |
|
public function addDetalleMercancia(array $attributes = []): DetalleMercancia |
74
|
|
|
{ |
75
|
1 |
|
$subject = $this->getDetalleMercancia(); |
76
|
1 |
|
$subject->addAttributes($attributes); |
77
|
1 |
|
return $subject; |
78
|
|
|
} |
79
|
|
|
} |
80
|
|
|
|