2017 © Pedro Peláez
 

bundle opentrans-bundle

This bundle integrates the opentrans library into Symfony2. Allows to create OpenTRANS compatible documents from PHP.

image

se/opentrans-bundle

This bundle integrates the opentrans library into Symfony2. Allows to create OpenTRANS compatible documents from PHP.

  • Friday, March 14, 2014
  • by sveneisenschmidt
  • Repository
  • 1 Watchers
  • 1 Stars
  • 138 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

OpenTransBundle

Latest Stable Version SensioLabsInsight, (*1)

This bundle integrates the [opentrans] (https://github.com/sveneisenschmidt/opentrans) library into Symfony2., (*2)

Dev branch is master branch.

Build Status, (*3)

Table of Contents

Installation, (*4)

Configuration, (*5)

Usage, (*6)

Tests, (*7)

, (*8)

Installation

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

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

Add the bundle to your AppKernel.php file:, (*10)

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new SE\Bundle\OpenTransBundle\SEOpenTransBundle(),
    // ...
);

Configuration

You can declare default documents in your app configuration. (i.e. app/config/config.yml), (*11)

se_open_trans:

  documents:

    my_default_order_document:
      type: order
      document:
        header:
          control_info:
            generator_info: "My Order Document"

    my_default_order_document_2:
      type: order
      document:
        header:
          control_info:
            generator_info: "My Order Document 2"
          order_info:
            custom_key: custom_var
            my_shop_id: Magento_1702

, (*12)

Usage

Your configured document builder is available as a member in se.opentrans.document_builder_manager service. Retrieve it by calling $manager->getDocumentBuilder($documentName)., (*13)

$manager = $container->get('se.opentrans.document_builder_manager');
$builder = $manager->getDocumentBuilder('my_default_order_document');
$document = $builder->getDocument();

The document builder is created as a service aswell. So instead calling the document builder manager you can directly load the document builder from the container. The name is consisting of the base key se.opentrans.document_builder. plus the se_open_trans.documents key from your configuration. (i.e. my_default_order_document), (*14)

$builder = $container->get('se.opentrans.document_builder.my_default_order_document');
$document = $builder->getDocument();

, (*15)

Run tests

bash $> vendor/bin/phpunit, (*16)

The Versions

14/03 2014

dev-master

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

This bundle integrates the opentrans library into Symfony2. Allows to create OpenTRANS compatible documents from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

xml symfony2 bundle serialization opentrans

14/03 2014

v0.1.3

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

This bundle integrates the opentrans library into Symfony2. Allows to create OpenTRANS compatible documents from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

xml symfony2 bundle serialization opentrans

16/12 2013

v0.1.3-beta

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

This bundle integrates the opentrans library into Symfony2. Allows to create OpenTRANS compatible documents from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

xml symfony2 bundle serialization opentrans

15/11 2013

v0.1.0

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

This bundle integrates the opentrans library into Symfony2. Allows to create OpenTRANS compatible documents from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

xml symfony2 bundle serialization opentrans

28/10 2013

v0.1-beta

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

This bundle integrates the opentrans library into Symfony2. Allows to create OpenTRANS compatible documents from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

xml symfony2 bundle serialization opentrans

28/10 2013

v0.1-alpha

0.1.0.0-alpha https://github.com/sveneisenschmidt/opentrans-bundle

This bundle integrates the opentrans library into Symfony2. Allows to create OpenTRANS compatible documents from PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

xml symfony2 bundle serialization opentrans