Blesta Source Documentation

InvoiceDataItems extends AbstractInvoiceItems

Build invoice data items

Table of Contents

Properties

$discounts
$itemFactory
$options
$pricingFactory
$settings
$taxes

Methods

__construct() Init
build() Builds invoice information into an ItemPriceCollection
getMeta() Retrieves all meta information set on a meta item combined together
getMetaFromCollection() Retrieves all meta information set on an item collection
makeMetaItemPrices() Creates a list of MetaItemPrices from a set of items
setTaxes() Updates the given MetaItemPrices to assign taxes
makeItems() Creates a set of MetaItemPrices for the service
updateMeta() Updates the given MetaItemInterface to set the first meta item with the given data
Properties
Methods

__construct()

Init

public __construct(PricingFactory $pricingFactory, ItemFactory $itemFactory, ItemInterface $settings[, ItemCollection $taxes = null ][, ItemInterface $options = null ]) : mixed
Parameters
$pricingFactory : PricingFactory

An instance of the PricingFactory

$itemFactory : ItemFactory

An instance of the ItemFactory

$settings : ItemInterface

An item containing a set of settings

$taxes : ItemCollection = null

A collection of items representing taxes

$options : ItemInterface = null

An item containing a set of custom options

build()

Builds invoice information into an ItemPriceCollection

public build(ItemInterface $invoice, ItemCollection $lines) : ItemPriceCollection
Parameters
$invoice : ItemInterface

An item representing the invoice

$lines : ItemCollection

A collection of items representing line items

Return values
ItemPriceCollection

getMeta()

Retrieves all meta information set on a meta item combined together

protected getMeta(MetaItemInterface $item) : array<string|int, mixed>
Parameters
$item : MetaItemInterface

The item whose meta information to retrieve

Return values
array<string|int, mixed>

An array of all meta data

getMetaFromCollection()

Retrieves all meta information set on an item collection

protected getMetaFromCollection(ItemCollection $collection) : array<string|int, mixed>
Parameters
$collection : ItemCollection

An item collection

Return values
array<string|int, mixed>

An array of all meta data

makeMetaItemPrices()

Creates a list of MetaItemPrices from a set of items

protected makeMetaItemPrices(array<string|int, mixed> $items) : An
Parameters
$items : array<string|int, mixed>

An array of items that each must contain:

  • price The price of the item
  • qty The quantity count of the item
  • key The item's key
  • description The item's description
  • meta Meta information about the item (optional)
Return values
An

array of MetaItemPrice objects representing each item

setTaxes()

Updates the given MetaItemPrices to assign taxes

protected setTaxes(array<string|int, mixed> $itemPrices) : array<string|int, mixed>
Parameters
$itemPrices : array<string|int, mixed>

An array of MetaItemPrices to assign taxes for

Return values
array<string|int, mixed>

The MetaTaxPrices with taxes assigned

makeItems()

Creates a set of MetaItemPrices for the service

private makeItems(ItemInterface $invoice, ItemCollection $lines) : array<string|int, mixed>
Parameters
$invoice : ItemInterface

An item representing the invoice

$lines : ItemCollection

A list of line items for the invoice

Return values
array<string|int, mixed>

An array of MetaItemPrices

updateMeta()

Updates the given MetaItemInterface to set the first meta item with the given data

private updateMeta(MetaItemInterface $item, array<string|int, mixed> $meta) : MetaItemInterface
Parameters
$item : MetaItemInterface

The item whose meta information to update

$meta : array<string|int, mixed>

The meta information to update the item with

Return values
MetaItemInterface

The updated item

Tags
subpackage

core.Pricing.Presenter.Items.Invoice

copyright

Copyright (c) 2019, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results