PHP Интерфейс Sonata\Component\Basket\BasketElementInterface

Наследование: extends Sonata\Component\Product\PriceComputableInterface
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
getDelete ( ) : boolean
getName ( ) : string return the name of the basket element.
getOption ( string $name, mixed $default = null ) : mixed return a option value depends on the $name.
getOptions ( ) : array return the basket element options array.
getPosition ( ) : integer return the pos of the current basket element.
getProduct ( ) : Sonata\Component\Product\ProductInterface Return the related product.
getProductCode ( ) : string
getProductId ( ) : integer return the product id.
getProductManager ( ) : Sonata\Component\Product\ProductManagerInterface
getProductProvider ( ) : Sonata\Component\Product\ProductProviderInterface
getTotal ( boolean $vat = false ) : float Return the total (price * quantity).
getVatAmount ( ) Returns the VAT amount.
isPriceIncludingVat ( ) : boolean Returns if price is including VAT.
isValid ( ) : boolean Check if the basket element is still valid.
setDelete ( boolean $delete )
setOption ( string $name, mixed $value ) Define the option value.
setPosition ( integer $position ) the position in the basket stack.
setPriceIncludingVat ( float $priceIncludingVat ) Sets if current price is including VAT.
setProduct ( string $productCode, Sonata\Component\Product\ProductInterface $product ) Define the related product.
setProductDefinition ( ProductDefinition $productDefinition )
setProductId ( integer $productId ) Never call this method, use the setProduct instead. This method is only used by the form framework.
setUnitPrice ( float $unitPrice ) Sets product unit price.

Описание методов

getDelete() публичный Метод

public getDelete ( ) : boolean
Результат boolean

getName() публичный Метод

return the name of the basket element.
public getName ( ) : string
Результат string

getOption() публичный Метод

return a option value depends on the $name.
public getOption ( string $name, mixed $default = null ) : mixed
$name string
$default mixed Default value if option not found
Результат mixed

getOptions() публичный Метод

return the basket element options array.
public getOptions ( ) : array
Результат array

getPosition() публичный Метод

return the pos of the current basket element.
public getPosition ( ) : integer
Результат integer

getProduct() публичный Метод

Return the related product.
public getProduct ( ) : Sonata\Component\Product\ProductInterface
Результат Sonata\Component\Product\ProductInterface

getProductCode() публичный Метод

public getProductCode ( ) : string
Результат string

getProductId() публичный Метод

return the product id.
public getProductId ( ) : integer
Результат integer

getProductManager() публичный Метод

public getProductManager ( ) : Sonata\Component\Product\ProductManagerInterface
Результат Sonata\Component\Product\ProductManagerInterface

getProductProvider() публичный Метод

public getProductProvider ( ) : Sonata\Component\Product\ProductProviderInterface
Результат Sonata\Component\Product\ProductProviderInterface

getTotal() публичный Метод

if $vat = true, return the price with vat
public getTotal ( boolean $vat = false ) : float
$vat boolean Returns price including VAT?
Результат float

getVatAmount() публичный Метод

Returns the VAT amount.
public getVatAmount ( )

isPriceIncludingVat() публичный Метод

Returns if price is including VAT.
public isPriceIncludingVat ( ) : boolean
Результат boolean

isValid() публичный Метод

Check if the basket element is still valid.
public isValid ( ) : boolean
Результат boolean

setDelete() публичный Метод

public setDelete ( boolean $delete )
$delete boolean

setOption() публичный Метод

Define the option value.
public setOption ( string $name, mixed $value )
$name string
$value mixed

setPosition() публичный Метод

the position in the basket stack.
public setPosition ( integer $position )
$position integer

setPriceIncludingVat() публичный Метод

Sets if current price is including VAT.
public setPriceIncludingVat ( float $priceIncludingVat )
$priceIncludingVat float

setProduct() публичный Метод

Define the related product.
public setProduct ( string $productCode, Sonata\Component\Product\ProductInterface $product )
$productCode string
$product Sonata\Component\Product\ProductInterface

setProductDefinition() публичный Метод

public setProductDefinition ( ProductDefinition $productDefinition )
$productDefinition Sonata\Component\Product\ProductDefinition

setProductId() публичный Метод

Never call this method, use the setProduct instead. This method is only used by the form framework.
public setProductId ( integer $productId )
$productId integer

setUnitPrice() публичный Метод

Sets product unit price.
public setUnitPrice ( float $unitPrice )
$unitPrice float