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

  • PricingFactory
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class PricingFactory

Instantiates pricing objects

Blesta\Pricing\PricingFactory
Extended by Blesta\Core\Pricing\PricingFactory
Namespace: Blesta\Core\Pricing
Package: blesta\core\Pricing
Copyright: Copyright (c) 2019, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at core/Pricing/PricingFactory.php
Methods summary
public
# __construct( array $options )

Init

Init

Parameters

$options

An array of key/value pairs representing any custom values, including:

  • dateFormat The date format to use
  • dateTimeFormat The datetime format to use
public Blesta\Core\Pricing\MetaItem\MetaItemPrice
# metaItemPrice( float $amount, integer $qty, string $key = null )

Creates an instance of the MetaItemPrice

Creates an instance of the MetaItemPrice

Parameters

$amount
The unit price
$qty
The quantity of unit price
$key
A unique identifier (optional, default null)

Returns

Blesta\Core\Pricing\MetaItem\MetaItemPrice
public Blesta\Core\Pricing\MetaItem\MetaDiscountPrice
# metaDiscountPrice( float $amount, string $type )

Creates an instance of the MetaDiscountPrice

Creates an instance of the MetaDiscountPrice

Parameters

$amount
The positive amount to discount
$type

The type of discount the $amount represents. One of:

  • percent The $amount represents a percentage discount (NOT already divided by 100)
  • amount The $amount represents an amount discount

Returns

Blesta\Core\Pricing\MetaItem\MetaDiscountPrice

Throws

InvalidArgumentException
If $amount is negative
public Blesta\Core\Pricing\MetaItem\MetaTaxPrice
# metaTaxPrice( float $amount, string $type )

Creates an instance of the MetaTaxPrice

Creates an instance of the MetaTaxPrice

Parameters

$amount
The positive tax amount as a percentage
$type

The type of tax the $rate represents. One of:

  • inclusive Prices include tax
  • exclusive Prices do not include tax

Returns

Blesta\Core\Pricing\MetaItem\MetaTaxPrice

Throws

InvalidArgumentException
If $amount is negative
public Blesta\Core\Pricing\ItemComparator\ItemComparator
# itemComparator( callable $priceCallback, callable $descriptionCallback )

Creates an instance of the ItemComparator

Creates an instance of the ItemComparator

Parameters

$priceCallback

The pricing callback that accepts four arguments for the old and new price, and the old and new ItemPrice meta data (each a Blesta\Items\Item\ItemCollection), and returns a float

$descriptionCallback

The description callback that accepts two arguments for the old and new ItemPrice meta data (each a Blesta\Items\Item\ItemCollection or null), and returns a string

Returns

Blesta\Core\Pricing\ItemComparator\ItemComparator
public Blesta\Core\Pricing\Modifier\Type\Discount\Coupon
# coupon( Blesta\Items\Item\ItemInterface $coupon, string $date )

Creates an instance of a Coupon

Creates an instance of a Coupon

Parameters

$coupon
A coupon item
$date
A date

Returns

Blesta\Core\Pricing\Modifier\Type\Discount\Coupon
public Blesta\Core\Pricing\Modifier\Type\Proration\Proration
# proration( )

Creates an instance of the Proration modifier

Creates an instance of the Proration modifier

Returns

Blesta\Core\Pricing\Modifier\Type\Proration\Proration
public Blesta\Core\Pricing\Modifier\Type\Description\Description
# description( )

Creates an instance of the Description modifier

Creates an instance of the Description modifier

Returns

Blesta\Core\Pricing\Modifier\Type\Description\Description
public Blesta\Core\Pricing\Modifier\Type\Price\ArrayMerge
# arrayMerge( )

Creates an instance of the ArrayMerge modifier

Creates an instance of the ArrayMerge modifier

Returns

Blesta\Core\Pricing\Modifier\Type\Price\ArrayMerge
public Minphp\Date\Date
# date( )

Creates an instance of the Minphp\Date\Date

Creates an instance of the Minphp\Date\Date

Returns

Minphp\Date\Date
Blesta API documentation generated by ApiGen