PHP Class Sonata\Component\Basket\Basket

Author: Thomas Rabaix ([email protected])
Inheritance: implements Serializable, implements Sonata\Component\Basket\BasketInterface
Datei anzeigen Open project: sonata-project/ecommerce Class Usage Examples

Protected Properties

Property Type Description
$basketElements array
$billingAddress Sonata\Component\Customer\AddressInterface
$billingAddressId integer
$cptElement integer
$currency Sonata\Component\Currency\CurrencyInterface
$customer Sonata\Component\Customer\CustomerInterface
$customerId integer
$deliveryAddress Sonata\Component\Customer\AddressInterface
$deliveryAddressId integer
$deliveryMethod Sonata\Component\Delivery\ServiceDeliveryInterface
$deliveryMethodCode string
$inBuild boolean
$locale string
$options array
$paymentMethod Sonata\Component\Payment\PaymentInterface
$paymentMethodCode string
$positions array
$productPool Sonata\Component\Product\Pool

Public Methods

Method Description
__construct ( )
addBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement )
buildPrices ( )
clean ( )
countBasketElements ( )
getBasketElements ( )
getBillingAddress ( )
getBillingAddressId ( )
getCurrency ( )
getCustomer ( )
getCustomerId ( )
getDeliveryAddress ( )
getDeliveryAddressId ( )
getDeliveryMethod ( )
getDeliveryMethodCode ( )
getDeliveryPrice ( $vat = false )
getDeliveryVat ( )
getElement ( Sonata\Component\Product\ProductInterface $product )
getElementByPos ( $pos )
getLocale ( )
getOption ( $name, $default = null )
getOptions ( )
getPaymentMethod ( )
getPaymentMethodCode ( )
getPositions ( )
getProductPool ( )
getSerializationFields ( )
getTotal ( $vat = false, $recurrentOnly = null )
getUnserializationFields ( )
getVatAmount ( )
getVatAmounts ( )
hasBasketElements ( )
hasProduct ( Sonata\Component\Product\ProductInterface $product )
hasRecurrentPayment ( )
isAddable ( Sonata\Component\Product\ProductInterface $product )
isEmpty ( )
isValid ( $elementsOnly = false )
removeBasketElement ( Sonata\Component\Basket\BasketElementInterface $element )
removeElement ( Sonata\Component\Basket\BasketElementInterface $element )
removeElements ( array $elementsToRemove )
reset ( $full = true )
serialize ( )
setBasketElements ( $basketElements )
setBillingAddress ( Sonata\Component\Customer\AddressInterface $address = null )
setBillingAddressId ( $billingAddressId )
setCurrency ( Sonata\Component\Currency\CurrencyInterface $currency )
setCustomer ( Sonata\Component\Customer\CustomerInterface $customer = null )
setCustomerId ( $customerId )
setDeliveryAddress ( Sonata\Component\Customer\AddressInterface $address = null )
setDeliveryAddressId ( $deliveryAddressId )
setDeliveryMethod ( Sonata\Component\Delivery\ServiceDeliveryInterface $method = null )
setDeliveryMethodCode ( $deliveryMethodCode )
setLocale ( $locale )
setOption ( $name, $value )
setOptions ( $options )
setPaymentMethod ( Sonata\Component\Payment\PaymentInterface $method = null )
setPaymentMethodCode ( $paymentMethodCode )
setProductPool ( Pool $pool )
unserialize ( $data )

Method Details

__construct() public method

public __construct ( )

addBasketElement() public method

public addBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement )
$basketElement Sonata\Component\Basket\BasketElementInterface

buildPrices() public method

public buildPrices ( )

clean() public method

public clean ( )

countBasketElements() public method

public countBasketElements ( )

getBasketElements() public method

public getBasketElements ( )

getBillingAddress() public method

public getBillingAddress ( )

getBillingAddressId() public method

public getBillingAddressId ( )

getCurrency() public method

public getCurrency ( )

getCustomer() public method

public getCustomer ( )

getCustomerId() public method

public getCustomerId ( )

getDeliveryAddress() public method

public getDeliveryAddress ( )

getDeliveryAddressId() public method

getDeliveryMethod() public method

public getDeliveryMethod ( )

getDeliveryMethodCode() public method

getDeliveryPrice() public method

public getDeliveryPrice ( $vat = false )

getDeliveryVat() public method

public getDeliveryVat ( )

getElement() public method

public getElement ( Sonata\Component\Product\ProductInterface $product )
$product Sonata\Component\Product\ProductInterface

getElementByPos() public method

public getElementByPos ( $pos )

getLocale() public method

public getLocale ( )

getOption() public method

public getOption ( $name, $default = null )

getOptions() public method

public getOptions ( )

getPaymentMethod() public method

public getPaymentMethod ( )

getPaymentMethodCode() public method

getPositions() public method

public getPositions ( )

getProductPool() public method

public getProductPool ( )

getSerializationFields() public method

getTotal() public method

public getTotal ( $vat = false, $recurrentOnly = null )

getUnserializationFields() public method

getVatAmount() public method

public getVatAmount ( )

getVatAmounts() public method

public getVatAmounts ( )

hasBasketElements() public method

public hasBasketElements ( )

hasProduct() public method

public hasProduct ( Sonata\Component\Product\ProductInterface $product )
$product Sonata\Component\Product\ProductInterface

hasRecurrentPayment() public method

public hasRecurrentPayment ( )

isAddable() public method

public isAddable ( Sonata\Component\Product\ProductInterface $product )
$product Sonata\Component\Product\ProductInterface

isEmpty() public method

public isEmpty ( )

isValid() public method

public isValid ( $elementsOnly = false )

removeBasketElement() public method

public removeBasketElement ( Sonata\Component\Basket\BasketElementInterface $element )
$element Sonata\Component\Basket\BasketElementInterface

removeElement() public method

public removeElement ( Sonata\Component\Basket\BasketElementInterface $element )
$element Sonata\Component\Basket\BasketElementInterface

removeElements() public method

public removeElements ( array $elementsToRemove )
$elementsToRemove array

reset() public method

public reset ( $full = true )

serialize() public method

public serialize ( )

setBasketElements() public method

public setBasketElements ( $basketElements )

setBillingAddress() public method

public setBillingAddress ( Sonata\Component\Customer\AddressInterface $address = null )
$address Sonata\Component\Customer\AddressInterface

setBillingAddressId() public method

public setBillingAddressId ( $billingAddressId )

setCurrency() public method

public setCurrency ( Sonata\Component\Currency\CurrencyInterface $currency )
$currency Sonata\Component\Currency\CurrencyInterface

setCustomer() public method

public setCustomer ( Sonata\Component\Customer\CustomerInterface $customer = null )
$customer Sonata\Component\Customer\CustomerInterface

setCustomerId() public method

public setCustomerId ( $customerId )

setDeliveryAddress() public method

public setDeliveryAddress ( Sonata\Component\Customer\AddressInterface $address = null )
$address Sonata\Component\Customer\AddressInterface

setDeliveryAddressId() public method

public setDeliveryAddressId ( $deliveryAddressId )

setDeliveryMethod() public method

public setDeliveryMethod ( Sonata\Component\Delivery\ServiceDeliveryInterface $method = null )
$method Sonata\Component\Delivery\ServiceDeliveryInterface

setDeliveryMethodCode() public method

public setDeliveryMethodCode ( $deliveryMethodCode )

setLocale() public method

public setLocale ( $locale )

setOption() public method

public setOption ( $name, $value )

setOptions() public method

public setOptions ( $options )

setPaymentMethod() public method

public setPaymentMethod ( Sonata\Component\Payment\PaymentInterface $method = null )
$method Sonata\Component\Payment\PaymentInterface

setPaymentMethodCode() public method

public setPaymentMethodCode ( $paymentMethodCode )

setProductPool() public method

public setProductPool ( Pool $pool )
$pool Sonata\Component\Product\Pool

unserialize() public method

public unserialize ( $data )

Property Details

$basketElements protected_oe property

protected array $basketElements
return array

$billingAddress protected_oe property

protected AddressInterface,Sonata\Component\Customer $billingAddress
return Sonata\Component\Customer\AddressInterface

$billingAddressId protected_oe property

protected int $billingAddressId
return integer

$cptElement protected_oe property

protected int $cptElement
return integer

$currency protected_oe property

protected CurrencyInterface,Sonata\Component\Currency $currency
return Sonata\Component\Currency\CurrencyInterface

$customer protected_oe property

protected CustomerInterface,Sonata\Component\Customer $customer
return Sonata\Component\Customer\CustomerInterface

$customerId protected_oe property

protected int $customerId
return integer

$deliveryAddress protected_oe property

protected AddressInterface,Sonata\Component\Customer $deliveryAddress
return Sonata\Component\Customer\AddressInterface

$deliveryAddressId protected_oe property

protected int $deliveryAddressId
return integer

$deliveryMethod protected_oe property

protected ServiceDeliveryInterface,Sonata\Component\Delivery $deliveryMethod
return Sonata\Component\Delivery\ServiceDeliveryInterface

$deliveryMethodCode protected_oe property

protected string $deliveryMethodCode
return string

$inBuild protected_oe property

protected bool $inBuild
return boolean

$locale protected_oe property

protected string $locale
return string

$options protected_oe property

protected array $options
return array

$paymentMethod protected_oe property

protected PaymentInterface,Sonata\Component\Payment $paymentMethod
return Sonata\Component\Payment\PaymentInterface

$paymentMethodCode protected_oe property

protected string $paymentMethodCode
return string

$positions protected_oe property

protected array $positions
return array

$productPool protected_oe property

protected Pool,Sonata\Component\Product $productPool
return Sonata\Component\Product\Pool