Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • AbstractServiceItems
  • ServiceDataItems
  • ServiceItems

Interfaces

  • ServiceItemsInterface
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class AbstractServiceItems

Abstract builder for service items

Blesta\Core\Pricing\Presenter\Items\Service\AbstractServiceItems implements Blesta\Core\Pricing\Presenter\Items\Service\ServiceItemsInterface uses Blesta\Core\Pricing\MetaItem\Meta

Direct known subclasses

Blesta\Core\Pricing\Presenter\Items\Service\ServiceDataItems, Blesta\Core\Pricing\Presenter\Items\Service\ServiceItems
Abstract
Namespace: Blesta\Core\Pricing\Presenter\Items\Service
Package: blesta\core\Pricing\Presenter\Items\Service
Copyright: Copyright (c) 2019, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at core/Pricing/Presenter/Items/Service/AbstractServiceItems.php
Methods summary
public
# __construct( Blesta\Core\Pricing\PricingFactory $pricingFactory, Blesta\Items\ItemFactory $itemFactory, Blesta\Items\Item\ItemInterface $settings, Blesta\Items\Collection\ItemCollection $taxes = null, Blesta\Items\Collection\ItemCollection $discounts = null, Blesta\Items\Item\ItemInterface $options = null )

Init

Init

Parameters

$pricingFactory
An instance of the PricingFactory
$itemFactory
An instance of the ItemFactory
$settings
An item containing a set of settings
$taxes
A collection of items representing taxes
$discounts
A collection of items representing discounts
$options
An item containing a set of custom options
protected
# getKey( string $name, string $type )

Creates a key using the given name and type

Creates a key using the given name and type

Parameters

$name
The name of the key to retrieve ('service' or 'serviceoption')
$type
The type of key ('item', 'setup', 'cancel')
protected array
# getDateRange( stdClass $pricing )

Retrieves the service date range

Retrieves the service date range

Parameters

$pricing

An stdClass object representing pricing, including:

  • term The pricing term
  • period The pricing period

Returns

array

A key => value array containing:

  • startDate The start date of the service
  • endDate The end date of the service
protected An
# makeMetaItemPrices( array $items )

Creates a list of MetaItemPrices from a set of items

Creates a list of MetaItemPrices from a set of items

Parameters

$items

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
  • meta Meta information about the item (optional)

Returns

An
array of MetaItemPrice objects representing each item
protected array
# setTaxes( array $itemPrices )

Updates the given MetaItemPrices to assign taxes

Updates the given MetaItemPrices to assign taxes

Parameters

$itemPrices
An array of MetaItemPrices to assign taxes for

Returns

array
The MetaTaxPrices with taxes assigned
protected array
# setDiscounts( array $itemPrices, array $packageIds )

Updates the given MetaItemPrices to assign discounts

Updates the given MetaItemPrices to assign discounts

Parameters

$itemPrices
An array of MetaItemPrices to assign discounts for
$packageIds

One of the following:

  • An array of package IDs that the discount must apply to
  • An array of package IDs mapped to periods and terms [packageID => [period => [term, term]]] that the discount must apply to

Returns

array
The MetaItemPrices with discounts assigned
Methods inherited from Blesta\Core\Pricing\Presenter\Items\Service\ServiceItemsInterface
build()
Methods used from Blesta\Core\Pricing\MetaItem\Meta
getMeta(), getMetaFromCollection()
Properties summary
protected Instance $pricingFactory

of PricingFactory

of PricingFactory

#
protected Instance $itemFactory

of ItemFactory

of ItemFactory

#
protected Blesta\Items\Collection\ItemCollection $discounts

A set of discounts

A set of discounts

#
protected Blesta\Items\Item\ItemInterface $options

Custom options

Custom options

#
protected Blesta\Items\Item\ItemInterface $settings

Settings

Settings

#
protected Blesta\Items\Collection\ItemCollection $taxes

A set of taxes

A set of taxes

#
Blesta API documentation generated by ApiGen