Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elementos de CartaPorte #73

Merged
merged 14 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/Arrendatario.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class Arrendatario extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:Arrendatario';
}

public function getDomicilio(): Domicilio
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return $this->helperGetOrAdd(new Domicilio());
}

public function addDomicilio(array $attributes = []): Domicilio
{
$domicilio = $this->getDomicilio();
$domicilio->addAttributes($attributes);

return $domicilio;
}
}
41 changes: 41 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/AutotransporteFederal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class AutotransporteFederal extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:AutotransporteFederal';
}

public function addIdentificacionVehicular(array $attributes = []): IdentificacionVehicular
{
$identificacionVehicular = new IdentificacionVehicular($attributes);
$this->addChild($identificacionVehicular);

return $identificacionVehicular;
}

public function getIdentificacionVehicular(): IdentificacionVehicular
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return $this->helperGetOrAdd(new IdentificacionVehicular());
}

public function addRemolques(array $attributes = []): Remolques
{
$remolques = new Remolques($attributes);
$this->addChild($remolques);

return $remolques;
}

public function getRemolques(): Remolques
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return $this->helperGetOrAdd(new Remolques());
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/CantidadTransporta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class CantidadTransporta extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:CantidadTransporta';
}
}
29 changes: 29 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/Carro.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class Carro extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:Carro';
}

public function addContenedor(array $attributes = []): Contenedor
{
$contenedor = new Contenedor($attributes);
$this->addChild($contenedor);

return $contenedor;
}

public function multiContenedor(array ...$elementAttributes): self
{
foreach ($elementAttributes as $attributes) {
$this->addContenedor($attributes);
}
return $this;
}
}
74 changes: 74 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/CartaPorte.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class CartaPorte extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:CartaPorte';
}

public function getChildrenOrder(): array
{
return [
'cartaporte:Ubicaciones',
'cartaporte:Mercancias',
'cartaporte:FiguraTransporte',
];
}

public function getFixedAttributes(): array
{
return [
'xmlns:cartaporte' => 'http://www.sat.gob.mx/cartaporte',
'xsi:schemaLocation' => 'http://www.sat.gob.mx/cartaporte'
. ' http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte.xsd',
'Version' => '1.0',
];
}

public function getUbicaciones(): Ubicaciones
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return $this->helperGetOrAdd(new Ubicaciones());
}

public function addUbicaciones(array $attributes = []): Ubicaciones
{
$ubicaciones = $this->getUbicaciones();
$ubicaciones->addAttributes($attributes);

return $ubicaciones;
}

public function getMercancias(): Mercancias
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return $this->helperGetOrAdd(new Mercancias());
}

public function addMercancias(array $attributes = []): Mercancias
{
$mercancias = $this->getMercancias();
$mercancias->addAttributes($attributes);

return $mercancias;
}

public function getFiguraTransporte(): FiguraTransporte
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return $this->helperGetOrAdd(new FiguraTransporte());
}

public function addFiguraTransporte(array $attributes = []): FiguraTransporte
{
$figuraTransporte = $this->getFiguraTransporte();
$figuraTransporte->addAttributes($attributes);

return $figuraTransporte;
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/Contenedor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class Contenedor extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:Contenedor';
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/DerechosDePaso.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class DerechosDePaso extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:DerechosDePaso';
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/Destino.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class Destino extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:Destino';
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/DetalleMercancia.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class DetalleMercancia extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:DetalleMercancia';
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/Domicilio.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class Domicilio extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:Domicilio';
}
}
77 changes: 77 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/FiguraTransporte.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class FiguraTransporte extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:FiguraTransporte';
}

public function addOperadores(array $attributes = []): Operadores
{
$operadores = new Operadores($attributes);
$this->addChild($operadores);

return $operadores;
}

public function multiOperadores(array ...$elementAttributes): self
{
foreach ($elementAttributes as $attributes) {
$this->addOperadores($attributes);
}
return $this;
}

public function addPropietario(array $attributes = []): Propietario
{
$propietario = new Propietario($attributes);
$this->addChild($propietario);

return $propietario;
}

public function multiPropietario(array ...$elementAttributes): self
{
foreach ($elementAttributes as $attributes) {
$this->addPropietario($attributes);
}
return $this;
}

public function addArrendatario(array $attributes = []): Arrendatario
{
$arrendatario = new Arrendatario($attributes);
$this->addChild($arrendatario);

return $arrendatario;
}

public function multiArrendatario(array ...$elementAttributes): self
{
foreach ($elementAttributes as $attributes) {
$this->addArrendatario($attributes);
}
return $this;
}

public function addNotificado(array $attributes = []): Notificado
{
$arrendatario = new Notificado($attributes);
$this->addChild($arrendatario);

return $arrendatario;
}

public function multiNotificado(array ...$elementAttributes): self
{
foreach ($elementAttributes as $attributes) {
$this->addNotificado($attributes);
}
return $this;
}
}
13 changes: 13 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/IdentificacionVehicular.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class IdentificacionVehicular extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:IdentificacionVehicular';
}
}
43 changes: 43 additions & 0 deletions src/CfdiUtils/Elements/CartaPorte10/Mercancia.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace CfdiUtils\Elements\CartaPorte10;

use CfdiUtils\Elements\Common\AbstractElement;

class Mercancia extends AbstractElement
{
public function getElementName(): string
{
return 'cartaporte:Mercancia';
}

public function addCantidadTransporta(array $attributes = []): CantidadTransporta
{
$cantidadTransporta = new CantidadTransporta($attributes);
$this->addChild($cantidadTransporta);

return $cantidadTransporta;
}

public function multiCantidadTransporta(array ...$elementAttributes): self
{
foreach ($elementAttributes as $attributes) {
$this->addCantidadTransporta($attributes);
}
return $this;
}

public function addDetalleMercancia(array $attributes = []): DetalleMercancia
{
$detalleMercancia = new DetalleMercancia($attributes);
$this->addChild($detalleMercancia);

return $detalleMercancia;
}

public function getDetalleMercancia(): DetalleMercancia
{
/** @noinspection PhpIncompatibleReturnTypeInspection */
return $this->helperGetOrAdd(new DetalleMercancia());
}
}
Loading