whoami7 - Manager
:
/
home
/
qbizpnmr
/
arif.umairtax.com
/
vendor
/
invoiceninja
/
ubl_invoice
/
src
/
Upload File:
files >> /home/qbizpnmr/arif.umairtax.com/vendor/invoiceninja/ubl_invoice/src/SettlementPeriod.php
<?php namespace CleverIt\UBL\Invoice; use Sabre\Xml\Writer; use Sabre\Xml\XmlSerializable; class SettlementPeriod extends BaseInvoice implements XmlSerializable { private $startDate; private $endDate; /** * @return \DateTime */ public function getStartDate(): \DateTime { return $this->startDate; } /** * @param \DateTime $startDate * @return self */ public function setStartDate(\DateTime $startDate): self { $this->startDate = $startDate; return $this; } /** * @return \DateTime */ public function getEndDate(): ?\DateTime { return $this->endDate; } /** * @param \DateTime $endDate * @return self */ public function setEndDate(\DateTime $endDate): self { $this->endDate = $endDate; return $this; } /** * The validate function that is called during xml writing to valid the data of the object. * * @throws InvalidArgumentException An error with information about required data that is missing to write the XML * @return void */ public function validate() { if ($this->startDate === null) { throw new \InvalidArgumentException('Missing startDate'); } if ($this->endDate === null) { throw new \InvalidArgumentException('Missing endDate'); } } /** * The xmlSerialize method is called during xml writing. * * @param Writer $writer * @return void */ public function xmlSerialize(Writer $writer): void { $this->validate(); $this->setProps([ Schema::CBC . 'StartDate' => $this->startDate->format('Y-m-d'), Schema::CBC . 'EndDate' => $this->endDate->format('Y-m-d'), [ 'name' => Schema::CBC . 'DurationMeasure', 'value' => $this->endDate->diff($this->startDate)->format('%d'), 'attributes' => [ 'unitCode' => 'DAY' ] ] ]); $writer->write($this->getProps()); } }
Copyright ©2021 || Defacer Indonesia