PHP Class Eccube\Service\CartService

Show file Open project: ec-cube/ec-cube Class Usage Examples

Public Properties

Property Type Description
$app Eccube\Application

Public Methods

Method Description
__construct ( Application $app )
addError ( string $error = null, string $productName = null ) : CartService
addProduct ( string $productClassId, integer $quantity = 1 ) : CartService
canAddProduct ( string $productClassId ) : boolean
canAddProductPayment ( Eccube\Entity\Master\ProductType $ProductType ) : boolean
clear ( ) : CartService
downProductQuantity ( string $productClassId ) : CartService
getCanAddProductType ( )
getCart ( ) : Eccube\Entity\Cart カートを取得します。
getError ( ) : string
getErrors ( ) : string[]
getMessages ( ) : string[]
getPreOrderId ( ) : string
getProductQuantity ( string $productClassId ) : integer
getProductTypes ( ) : array
isLocked ( ) : boolean
lock ( )
removeProduct ( string $productClassId ) : CartService
save ( )
setCanAddProductType ( Eccube\Entity\Master\ProductType $ProductType )
setError ( string $error = null ) : CartService
setMessage ( string $message ) : CartService
setPreOrderId ( string $pre_order_id ) : CartService
setProductQuantity ( Eccube\Entity\ProductClass | integer $ProductClass, integer $quantity ) : CartService
unlock ( )
upProductQuantity ( string $productClassId ) : CartService

Protected Methods

Method Description
loadProductClassFromCart ( ) カートに保存されている商品の ProductClass エンティティを読み込み、カートへ設定します。
loadProductClassFromCartItem ( Eccube\Entity\CartItem $CartItem ) CartItem に対応する ProductClass を設定します。

Method Details

__construct() public method

public __construct ( Application $app )
$app Eccube\Application

addError() public method

public addError ( string $error = null, string $productName = null ) : CartService
$error string
$productName string
return CartService

addProduct() public method

public addProduct ( string $productClassId, integer $quantity = 1 ) : CartService
$productClassId string
$quantity integer
return CartService

canAddProduct() public method

public canAddProduct ( string $productClassId ) : boolean
$productClassId string
return boolean

canAddProductPayment() public method

public canAddProductPayment ( Eccube\Entity\Master\ProductType $ProductType ) : boolean
$ProductType Eccube\Entity\Master\ProductType
return boolean

clear() public method

public clear ( ) : CartService
return CartService

downProductQuantity() public method

public downProductQuantity ( string $productClassId ) : CartService
$productClassId string
return CartService

getCanAddProductType() public method

getCart() public method

カートを取得します。
public getCart ( ) : Eccube\Entity\Cart
return Eccube\Entity\Cart

getError() public method

public getError ( ) : string
return string

getErrors() public method

public getErrors ( ) : string[]
return string[]

getMessages() public method

public getMessages ( ) : string[]
return string[]

getPreOrderId() public method

public getPreOrderId ( ) : string
return string

getProductQuantity() public method

public getProductQuantity ( string $productClassId ) : integer
$productClassId string
return integer

getProductTypes() public method

public getProductTypes ( ) : array
return array

isLocked() public method

public isLocked ( ) : boolean
return boolean

loadProductClassFromCart() protected method

カートに保存されている商品の ProductClass エンティティを読み込み、カートへ設定します。
protected loadProductClassFromCart ( )

loadProductClassFromCartItem() protected method

CartItem に対応する ProductClass を設定します。
protected loadProductClassFromCartItem ( Eccube\Entity\CartItem $CartItem )
$CartItem Eccube\Entity\CartItem

lock() public method

public lock ( )

removeProduct() public method

public removeProduct ( string $productClassId ) : CartService
$productClassId string
return CartService

save() public method

public save ( )

setCanAddProductType() public method

public setCanAddProductType ( Eccube\Entity\Master\ProductType $ProductType )
$ProductType Eccube\Entity\Master\ProductType

setError() public method

public setError ( string $error = null ) : CartService
$error string
return CartService

setMessage() public method

public setMessage ( string $message ) : CartService
$message string
return CartService

setPreOrderId() public method

public setPreOrderId ( string $pre_order_id ) : CartService
$pre_order_id string
return CartService

setProductQuantity() public method

public setProductQuantity ( Eccube\Entity\ProductClass | integer $ProductClass, integer $quantity ) : CartService
$ProductClass Eccube\Entity\ProductClass | integer
$quantity integer
return CartService

unlock() public method

public unlock ( )

upProductQuantity() public method

public upProductQuantity ( string $productClassId ) : CartService
$productClassId string
return CartService

Property Details

$app public property

public Application,Eccube $app
return Eccube\Application