PHP Interface Sonata\Component\Basket\BasketElementInterface

Inheritance: extends Sonata\Component\Product\PriceComputableInterface
Afficher le fichier Open project: sonata-project/ecommerce Interface Usage Examples

Méthodes publiques

Méthode Description
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.

Method Details

getDelete() public méthode

public getDelete ( ) : boolean
Résultat boolean

getName() public méthode

return the name of the basket element.
public getName ( ) : string
Résultat string

getOption() public méthode

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
Résultat mixed

getOptions() public méthode

return the basket element options array.
public getOptions ( ) : array
Résultat array

getPosition() public méthode

return the pos of the current basket element.
public getPosition ( ) : integer
Résultat integer

getProduct() public méthode

Return the related product.
public getProduct ( ) : Sonata\Component\Product\ProductInterface
Résultat Sonata\Component\Product\ProductInterface

getProductCode() public méthode

public getProductCode ( ) : string
Résultat string

getProductId() public méthode

return the product id.
public getProductId ( ) : integer
Résultat integer

getProductManager() public méthode

public getProductManager ( ) : Sonata\Component\Product\ProductManagerInterface
Résultat Sonata\Component\Product\ProductManagerInterface

getProductProvider() public méthode

public getProductProvider ( ) : Sonata\Component\Product\ProductProviderInterface
Résultat Sonata\Component\Product\ProductProviderInterface

getTotal() public méthode

if $vat = true, return the price with vat
public getTotal ( boolean $vat = false ) : float
$vat boolean Returns price including VAT?
Résultat float

getVatAmount() public méthode

Returns the VAT amount.
public getVatAmount ( )

isPriceIncludingVat() public méthode

Returns if price is including VAT.
public isPriceIncludingVat ( ) : boolean
Résultat boolean

isValid() public méthode

Check if the basket element is still valid.
public isValid ( ) : boolean
Résultat boolean

setDelete() public méthode

public setDelete ( boolean $delete )
$delete boolean

setOption() public méthode

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

setPosition() public méthode

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

setPriceIncludingVat() public méthode

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

setProduct() public méthode

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

setProductDefinition() public méthode

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

setProductId() public méthode

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

setUnitPrice() public méthode

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