Метод |
Описание |
|
addBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement ) |
Add a basket element into the current basket. |
|
buildPrices ( ) |
Compute the price of the basket. |
|
clean ( ) |
remove basket element market as deleted. |
|
countBasketElements ( ) : integer |
count number of element in the basket. |
|
getBasketElements ( ) : Sonata\Component\Basket\BasketElementInterface[] |
return BasketElements. |
|
getBillingAddress ( ) : Sonata\Component\Customer\AddressInterface |
|
|
getBillingAddressId ( ) : integer |
|
|
getCurrency ( ) : Sonata\Component\Currency\CurrencyInterface |
|
|
getCustomer ( ) |
|
|
getCustomerId ( ) : integer |
|
|
getDeliveryAddress ( ) : Sonata\Component\Customer\AddressInterface |
|
|
getDeliveryAddressId ( ) : integer |
|
|
getDeliveryMethod ( ) : Sonata\Component\Delivery\ServiceDeliveryInterface |
|
|
getDeliveryMethodCode ( ) : string |
|
|
getDeliveryPrice ( boolean $vat = false ) : float |
return the Delivery price. |
|
getDeliveryVat ( ) : float |
returns the Delivery VAT rate. |
|
getElement ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Basket\BasketElementInterface |
return the BasketElement depends on the $product or the position from the element stacks. |
|
getLocale ( ) : string |
|
|
getPaymentMethod ( ) : Sonata\Component\Payment\PaymentInterface |
|
|
getPaymentMethodCode ( ) : string |
|
|
getPositions ( ) : array |
|
|
getProductPool ( ) : Pool |
|
|
getSerializationFields ( ) : array |
Retrieves fields and associated values use for serialization
Used by serialize method. |
|
getTotal ( boolean $vat = false, boolean $recurrentOnly = null ) : float |
return the total of the basket
if $vat = true, return price with vat
if $recurrent_only = true, return price for recurrent product only
if $recurrent_only = false, return price for non recurrent product only. |
|
getUnserializationFields ( ) : array |
Retrieves fields for deserialization
Used by unserialize method. |
|
getVatAmount ( ) : float |
Returns the VAT of the current basket. |
|
getVatAmounts ( ) : array |
Returns an array with all VAT amounts of the current basket. |
|
hasBasketElements ( ) : boolean |
return true if the basket has some elements . |
|
hasProduct ( Sonata\Component\Product\ProductInterface $product ) : boolean |
check if the basket contains $product. |
|
hasRecurrentPayment ( ) : boolean |
return true if the basket has a least one recurrent product (subscription). |
|
isAddable ( Sonata\Component\Product\ProductInterface $product ) : boolean |
Check if the product can be added to the basket. |
|
isEmpty ( ) : boolean |
test is the basket has elements. |
|
isValid ( boolean $elementsOnly = false ) : boolean |
Check is the basket is valid : elements, Payment and Delivery information. |
|
removeBasketElement ( Sonata\Component\Basket\BasketElementInterface $element ) : Sonata\Component\Basket\BasketElementInterface |
delete an element from the basket depend on the $element. Element
can be a product or a basket element. |
|
removeElement ( Sonata\Component\Basket\BasketElementInterface $element ) : Sonata\Component\Basket\BasketElementInterface |
delete an element from the basket depend on the $element. Element
can be a product or a basket element. |
|
removeElements ( array $elementsToRemove ) |
deletes several elements from the basket. |
|
reset ( boolean $full = true ) |
reset basket. |
|
setBasketElements ( array $elements ) |
Warning : this method should be only used by the validation framework. |
|
setBillingAddress ( Sonata\Component\Customer\AddressInterface $address = null ) |
set the Payment address. |
|
setBillingAddressId ( integer $billingAddressId ) |
|
|
setCurrency ( Sonata\Component\Currency\CurrencyInterface $currency ) |
|
|
setCustomer ( Sonata\Component\Customer\CustomerInterface $customer = null ) |
|
|
setCustomerId ( integer $customerId ) |
|
|
setDeliveryAddress ( Sonata\Component\Customer\AddressInterface $address = null ) |
set the Delivery address. |
|
setDeliveryAddressId ( integer $deliveryAddressId ) |
|
|
setDeliveryMethod ( Sonata\Component\Delivery\ServiceDeliveryInterface $method = null ) |
set the Delivery method. |
|
setLocale ( string $locale ) |
|
|
setPaymentMethod ( Sonata\Component\Payment\PaymentInterface $method = null ) |
set Payment method. |
|
setPaymentMethodCode ( string $paymentMethodCode ) |
|
|
setProductPool ( Pool $pool ) |
|
|