noka-design/php-ubl

Deserialize UBL xml to PHP objects

v0.3 2020-11-30 10:18 UTC

This package is auto-updated.

Last update: 2024-11-18 16:36:23 UTC


README

Deserialize UBL v2.0 Invoices (xml) to PHP objects, or vice versa.

Installation

composer require noka-design/php-ubl

Usage

$serializer = \NOKA\PHPUBL\PHPUBL::getSerializer();
$xml = file_get_contents('path/to/invoice.sml');
$invoice = $serializer->deserialize($xml, \NOKA\PHPUBL\UBL\Invoice::class, 'xml');

Credits

Classes generated using xsd2php

Uses JMS Serializer for serializing/deserializing

Uses UBL 2.0 schema definitions from Oasis