-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from danielebuso/master
Aggiunta la possibilità di specificare AltriDatiGestionali nei nodi DettaglioLinee
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/FatturaElettronica/FatturaElettronicaBody/DatiBeniServizi/AltriDatiGestionali.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
/** | ||
* This file is part of deved/fattura-elettronica | ||
* | ||
* Copyright (c) Salvatore Guarino <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
|
||
namespace Deved\FatturaElettronica\FatturaElettronica\FatturaElettronicaBody\DatiBeniServizi; | ||
|
||
use Deved\FatturaElettronica\Traits\MagicFieldsTrait; | ||
use Deved\FatturaElettronica\XmlSerializableInterface; | ||
|
||
class AltriDatiGestionali implements XmlSerializableInterface | ||
{ | ||
use MagicFieldsTrait; | ||
|
||
/** @var string */ | ||
public $tipoDato; | ||
/** @var string */ | ||
public $riferimentoTesto; | ||
/** @var string */ | ||
public $riferimentoNumero; | ||
/** @var string */ | ||
public $riferimentoData; | ||
|
||
/** | ||
* AltriDatiGestionali constructor. | ||
* | ||
* @param $tipoDato | ||
* @param null $riferimentoTesto | ||
* @param null $riferimentoNumero | ||
* @param null $riferimentoData | ||
*/ | ||
public function __construct($tipoDato, $riferimentoTesto = null, $riferimentoNumero = null, $riferimentoData = null) | ||
{ | ||
$this->tipoDato = $tipoDato; | ||
$this->riferimentoTesto = $riferimentoTesto; | ||
$this->riferimentoNumero = $riferimentoNumero; | ||
$this->riferimentoData = $riferimentoData; | ||
} | ||
|
||
/** | ||
* @param \XMLWriter $writer | ||
* @return \XMLWriter | ||
*/ | ||
public function toXmlBlock(\XMLWriter $writer) | ||
{ | ||
$writer->startElement('AltriDatiGestionali'); | ||
$writer->writeElement('TipoDato', $this->tipoDato); | ||
if ($this->riferimentoTesto) $writer->writeElement('RiferimentoTesto', $this->riferimentoTesto); | ||
if ($this->riferimentoNumero) $writer->writeElement('RiferimentoNumero', $this->riferimentoNumero); | ||
if ($this->riferimentoData) $writer->writeElement('RiferimentoData', $this->riferimentoData); | ||
$this->writeXmlFields($writer); | ||
$writer->endElement(); | ||
return $writer; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters