PHP Class Sonata\Component\Transformer\InvoiceTransformer

Author: Hugo Briand ([email protected])
Inheritance: extends BaseTransformer
Show file Open project: sonata-project/ecommerce Class Usage Examples

Protected Properties

Property Type Description
$deliveryPool Sonata\Component\Delivery\Pool
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$invoiceElementManager Sonata\Component\Invoice\InvoiceElementManagerInterface

Public Methods

Method Description
__construct ( Sonata\Component\Invoice\InvoiceElementManagerInterface $invoiceElementManager, Pool $deliveryPool, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher ) Constructor.
transformFromOrder ( Sonata\Component\Order\OrderInterface $order, Sonata\Component\Invoice\InvoiceInterface $invoice ) Transforms an order into an invoice.

Protected Methods

Method Description
addDelivery ( Sonata\Component\Invoice\InvoiceInterface $invoice, Sonata\Component\Order\OrderInterface $order ) Adds the delivery information from $order to $invoice.
createInvoiceElementFromOrderElement ( Sonata\Component\Order\OrderElementInterface $orderElement ) : Sonata\Component\Invoice\InvoiceElementInterface Creates an InvoiceElement based on an OrderElement.

Method Details

__construct() public method

Constructor.
public __construct ( Sonata\Component\Invoice\InvoiceElementManagerInterface $invoiceElementManager, Pool $deliveryPool, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher )
$invoiceElementManager Sonata\Component\Invoice\InvoiceElementManagerInterface Invoice element manager
$deliveryPool Sonata\Component\Delivery\Pool Delivery pool component
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface

addDelivery() protected method

Adds the delivery information from $order to $invoice.
protected addDelivery ( Sonata\Component\Invoice\InvoiceInterface $invoice, Sonata\Component\Order\OrderInterface $order )
$invoice Sonata\Component\Invoice\InvoiceInterface
$order Sonata\Component\Order\OrderInterface

createInvoiceElementFromOrderElement() protected method

Creates an InvoiceElement based on an OrderElement.
protected createInvoiceElementFromOrderElement ( Sonata\Component\Order\OrderElementInterface $orderElement ) : Sonata\Component\Invoice\InvoiceElementInterface
$orderElement Sonata\Component\Order\OrderElementInterface
return Sonata\Component\Invoice\InvoiceElementInterface

transformFromOrder() public method

Transforms an order into an invoice.
public transformFromOrder ( Sonata\Component\Order\OrderInterface $order, Sonata\Component\Invoice\InvoiceInterface $invoice )
$order Sonata\Component\Order\OrderInterface
$invoice Sonata\Component\Invoice\InvoiceInterface

Property Details

$deliveryPool protected property

protected Pool,Sonata\Component\Delivery $deliveryPool
return Sonata\Component\Delivery\Pool

$eventDispatcher protected property

protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher
return Symfony\Component\EventDispatcher\EventDispatcherInterface

$invoiceElementManager protected property

protected InvoiceElementManagerInterface,Sonata\Component\Invoice $invoiceElementManager
return Sonata\Component\Invoice\InvoiceElementManagerInterface