PHP 인터페이스 Sonata\Component\Basket\BasketInterface

파일 보기 프로젝트 열기: sonata-project/ecommerce 0 사용 예제들

공개 메소드들

메소드 설명
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 )

메소드 상세

addBasketElement() 공개 메소드

Add a basket element into the current basket.
public addBasketElement ( Sonata\Component\Basket\BasketElementInterface $basketElement )
$basketElement Sonata\Component\Basket\BasketElementInterface

buildPrices() 공개 메소드

Compute the price of the basket.
public buildPrices ( )

clean() 공개 메소드

remove basket element market as deleted.
public clean ( )

countBasketElements() 공개 메소드

count number of element in the basket.
public countBasketElements ( ) : integer
리턴 integer

getBasketElements() 공개 메소드

return BasketElements.
public getBasketElements ( ) : Sonata\Component\Basket\BasketElementInterface[]
리턴 Sonata\Component\Basket\BasketElementInterface[]

getBillingAddress() 공개 메소드

public getBillingAddress ( ) : Sonata\Component\Customer\AddressInterface
리턴 Sonata\Component\Customer\AddressInterface

getBillingAddressId() 공개 메소드

public getBillingAddressId ( ) : integer
리턴 integer

getCurrency() 공개 메소드

public getCurrency ( ) : Sonata\Component\Currency\CurrencyInterface
리턴 Sonata\Component\Currency\CurrencyInterface

getCustomer() 공개 메소드

public getCustomer ( )

getCustomerId() 공개 메소드

public getCustomerId ( ) : integer
리턴 integer

getDeliveryAddress() 공개 메소드

public getDeliveryAddress ( ) : Sonata\Component\Customer\AddressInterface
리턴 Sonata\Component\Customer\AddressInterface

getDeliveryAddressId() 공개 메소드

public getDeliveryAddressId ( ) : integer
리턴 integer

getDeliveryMethod() 공개 메소드

public getDeliveryMethod ( ) : Sonata\Component\Delivery\ServiceDeliveryInterface
리턴 Sonata\Component\Delivery\ServiceDeliveryInterface

getDeliveryMethodCode() 공개 메소드

public getDeliveryMethodCode ( ) : string
리턴 string

getDeliveryPrice() 공개 메소드

return the Delivery price.
public getDeliveryPrice ( boolean $vat = false ) : float
$vat boolean
리턴 float

getDeliveryVat() 공개 메소드

returns the Delivery VAT rate.
public getDeliveryVat ( ) : float
리턴 float

getElement() 공개 메소드

return the BasketElement depends on the $product or the position from the element stacks.
public getElement ( Sonata\Component\Product\ProductInterface $product ) : Sonata\Component\Basket\BasketElementInterface
$product Sonata\Component\Product\ProductInterface
리턴 Sonata\Component\Basket\BasketElementInterface

getLocale() 공개 메소드

public getLocale ( ) : string
리턴 string

getPaymentMethod() 공개 메소드

public getPaymentMethod ( ) : Sonata\Component\Payment\PaymentInterface
리턴 Sonata\Component\Payment\PaymentInterface

getPaymentMethodCode() 공개 메소드

public getPaymentMethodCode ( ) : string
리턴 string

getPositions() 공개 메소드

public getPositions ( ) : array
리턴 array

getProductPool() 공개 메소드

public getProductPool ( ) : Pool
리턴 Sonata\Component\Product\Pool

getSerializationFields() 공개 메소드

Retrieves fields and associated values use for serialization Used by serialize method.
public getSerializationFields ( ) : array
리턴 array

getTotal() 공개 메소드

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.
public getTotal ( boolean $vat = false, boolean $recurrentOnly = null ) : float
$vat boolean Returns price including VAT?
$recurrentOnly boolean Is recurrent only?
리턴 float

getUnserializationFields() 공개 메소드

Retrieves fields for deserialization Used by unserialize method.
public getUnserializationFields ( ) : array
리턴 array

getVatAmount() 공개 메소드

Returns the VAT of the current basket.
public getVatAmount ( ) : float
리턴 float

getVatAmounts() 공개 메소드

Returns an array with all VAT amounts of the current basket.
public getVatAmounts ( ) : array
리턴 array

hasBasketElements() 공개 메소드

..
public hasBasketElements ( ) : boolean
리턴 boolean

hasProduct() 공개 메소드

check if the basket contains $product.
public hasProduct ( Sonata\Component\Product\ProductInterface $product ) : boolean
$product Sonata\Component\Product\ProductInterface
리턴 boolean

hasRecurrentPayment() 공개 메소드

@return bool
public hasRecurrentPayment ( ) : boolean
리턴 boolean

isAddable() 공개 메소드

Check if the product can be added to the basket.
public isAddable ( Sonata\Component\Product\ProductInterface $product ) : boolean
$product Sonata\Component\Product\ProductInterface
리턴 boolean

isEmpty() 공개 메소드

test is the basket has elements.
public isEmpty ( ) : boolean
리턴 boolean

isValid() 공개 메소드

if $element_only is set to true, only elements are checked
public isValid ( boolean $elementsOnly = false ) : boolean
$elementsOnly boolean
리턴 boolean

removeBasketElement() 공개 메소드

delete an element from the basket depend on the $element. Element can be a product or a basket element.
public removeBasketElement ( Sonata\Component\Basket\BasketElementInterface $element ) : Sonata\Component\Basket\BasketElementInterface
$element Sonata\Component\Basket\BasketElementInterface
리턴 Sonata\Component\Basket\BasketElementInterface

removeElement() 공개 메소드

delete an element from the basket depend on the $element. Element can be a product or a basket element.
사용 중단: Use RemoveBasketElement instead
public removeElement ( Sonata\Component\Basket\BasketElementInterface $element ) : Sonata\Component\Basket\BasketElementInterface
$element Sonata\Component\Basket\BasketElementInterface
리턴 Sonata\Component\Basket\BasketElementInterface

removeElements() 공개 메소드

deletes several elements from the basket.
public removeElements ( array $elementsToRemove )
$elementsToRemove array

reset() 공개 메소드

reset basket.
public reset ( boolean $full = true )
$full boolean

setBasketElements() 공개 메소드

Warning : this method should be only used by the validation framework.
public setBasketElements ( array $elements )
$elements array

setBillingAddress() 공개 메소드

set the Payment address.
public setBillingAddress ( Sonata\Component\Customer\AddressInterface $address = null )
$address Sonata\Component\Customer\AddressInterface

setBillingAddressId() 공개 메소드

public setBillingAddressId ( integer $billingAddressId )
$billingAddressId integer

setCurrency() 공개 메소드

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

setCustomer() 공개 메소드

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

setCustomerId() 공개 메소드

public setCustomerId ( integer $customerId )
$customerId integer

setDeliveryAddress() 공개 메소드

set the Delivery address.
public setDeliveryAddress ( Sonata\Component\Customer\AddressInterface $address = null )
$address Sonata\Component\Customer\AddressInterface

setDeliveryAddressId() 공개 메소드

public setDeliveryAddressId ( integer $deliveryAddressId )
$deliveryAddressId integer

setDeliveryMethod() 공개 메소드

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

setLocale() 공개 메소드

public setLocale ( string $locale )
$locale string

setPaymentMethod() 공개 메소드

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

setPaymentMethodCode() 공개 메소드

public setPaymentMethodCode ( string $paymentMethodCode )
$paymentMethodCode string

setProductPool() 공개 메소드

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