<?php
namespace ModulesAbstract\ElectronicInvoice\UBL30Exporter;

class CreditNote extends ExporterAbstract
{

	protected $namespaces = [
		'root' => 	'urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2',
		'cac' => 	'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2',
		'cbc' => 	'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2',
	];

	/**
	 * {@inheritDoc}
	 * @see \ModulesAbstract\ElectronicInvoice\UBL30Exporter\ExporterAbstract::generate()
	 */
	public function generate()
	{
		$xml = new \Engine\SimpleXmlElement(<<<XML
<?xml version="1.0" encoding="UTF-8"?>
<CreditNote
	xmlns:cac="{$this->namespaces['cac']}"
	xmlns:cbc="{$this->namespaces['cbc']}"
	xmlns="{$this->namespaces['root']}"
></CreditNote>
XML
		);

		// there is no need to assign it back at this point
		$this->generateObjectTag($xml, $this->peppolStructure);

		return $xml;
	}

}
