PHP Interface Sonata\Component\Product\PriceComputableInterface

This interface describes required fields for price computation
Author: Vincent Composieux ([email protected])
Mostra file Open project: sonata-project/ecommerce

Public Methods

Method Description
getPrice ( boolean $vat = false ) : float Returns price of the element (including quantity).
getQuantity ( ) : integer Gets quantity.
getUnitPrice ( boolean $vat = false ) : float Returns the unit price.
getVatRate ( ) : float Gets VAT rate.
setPrice ( float $price ) Sets price.
setQuantity ( integer $quantity ) Sets quantity.
setVatRate ( float $vatRate ) Sets VAT rate.

Method Details

getPrice() public method

Returns price of the element (including quantity).
public getPrice ( boolean $vat = false ) : float
$vat boolean
return float

getQuantity() public method

Gets quantity.
public getQuantity ( ) : integer
return integer $quantity

getUnitPrice() public method

if $vat = true, returns the unit price with vat
public getUnitPrice ( boolean $vat = false ) : float
$vat boolean
return float

getVatRate() public method

Gets VAT rate.
public getVatRate ( ) : float
return float

setPrice() public method

Sets price.
public setPrice ( float $price )
$price float

setQuantity() public method

Sets quantity.
public setQuantity ( integer $quantity )
$quantity integer

setVatRate() public method

Sets VAT rate.
public setVatRate ( float $vatRate )
$vatRate float