first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace WPO\WC\UBL\Builders;
use Sabre\Xml\Service;
use WPO\WC\UBL\Documents\Document;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class SabreBuilder extends Builder {
/** Service */
private $service;
public function __construct() {
$this->service = new Service();
}
public function build( Document $document ) {
// Sabre wants namespaces in value/key format, so we need to flip it
$namespaces = array_flip( $document->get_namespaces() );
$this->service->namespaceMap = $namespaces;
return $this->service->write( 'Invoice', $document->get_data() );
}
}