2017 © Pedro Peláez
 

library opentrans

Allows to read, create and write OpenTRANS compatible documents

image

se/opentrans

Allows to read, create and write OpenTRANS compatible documents

  • Monday, December 16, 2013
  • by sveneisenschmidt
  • Repository
  • 3 Watchers
  • 7 Stars
  • 268 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 8 Forks
  • 1 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

OpenTrans

Latest Stable Version SensioLabsInsight, (*1)

Allows you to read, create and write OpenTRANS compatible documents from PHP, (*2)

Dev branch is master branch.

Build Status, (*3)

Table of Contents

Installation, (*4)

Usage, (*5)

Roadmap, (*6)

, (*7)

Installation

The recommended way to install is through Composer., (*8)

{
    "require": {
        "se/opentrans": "dev-master"
    }
}

, (*9)

Usage

, (*10)

Build document

Assuming you already have a builder (See document factory), (*11)

``` php getDocument(); $document->getHeader()->getOrderInfo()->setOrderId('00000000001'); $orderLine1 = new OpenTrans\Node\Order\ItemNode(); $orderLine1->setLineId('P00000001'); $document->addItem($orderLine1); $xml = $builder->serialize(); ``` Returns: ``` xml GENERATOR_INFO/ GENERATION_DATE/ 00000000001 P00000001 ORDER_SUMMARY/ , (*12)



<a name="factory"></a> ### Document factory ``` php <?php use \SE\Component\OpenTrans; // Pick a factory to create your document (i.e. an Order) $loader = new OpenTrans\NodeLoader(); $factory = new OpenTrans\DocumentFactory\OrderFactory($loader); $builder = new OpenTrans\DocumentBuilder($factory); $builder->build(); // bootstraps the default document structure $document = $builder->getDocument(); // ... build your document

Resolve document factory by document type

``` php <?php, (*13)

use \SE\Component\OpenTrans;, (*14)

// Let the DocumentFactoryResolver pick the factory you need, (*15)

$loader = new OpenTrans\NodeLoader(); $factoryClass = OpenTrans\DocumentFactory\DocumentFactoryResolver::resolveFactory( $loader, OpenTrans\DocumentType::DOCUMENT_ORDER );, (*16)

$factory = new $factoryClass($loader); $builder = new OpenTrans\DocumentBuilder($factory); $builder->build(); // bootstraps the default document structure, (*17)

$document = $builder->getDocument(); // ... build your document, (*18)


<a name="tests"></a> ### Run tests ``` bash $> vendor/bin/phpunit

, (*19)

Symfony2 bundle

This library is integrated into Symfony2 through the OpenTransBundle., (*20)

, (*21)

Roadmap

  • Implement Document types
    • (x) Order
    • ( ) Invoice
    • ( ) OrderChange
    • ( ) OrderResponse
    • ( ) Quotation
    • ( ) RFQ
    • ( ) ReceiptAcknowledgement

The Versions

16/12 2013

dev-master

9999999-dev https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS compatible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans

16/12 2013

v0.1.3

0.1.3.0 https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS compatible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans

16/12 2013

v0.1.3-beta

0.1.3.0-beta https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS compatible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans

09/12 2013

v0.1.2

0.1.2.0 https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS compatible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans

15/11 2013

v0.1.1

0.1.1.0 https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS compatible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans

29/10 2013

v0.1.0

0.1.0.0 https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS compatible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans

28/10 2013

v0.1-beta3

0.1.0.0-beta3 https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS compatible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans

28/10 2013

v0.1-beta2

0.1.0.0-beta2 https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS compatible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans

28/10 2013

v0.1-beta

0.1.0.0-beta https://github.com/sveneisenschmidt/opentrans

Allows to read, create and write OpenTRANS comptaible documents

  Sources   Download

MIT

The Requires

 

The Development Requires

xml serialization document opentrans