PHP 클래스 OrderItem, silvershop-core

파일 보기 프로젝트 열기: burnbright/silverstripe-shop 1 사용 예제들

공개 메소드들

메소드 설명
Buyable ( ) Get the buyable object related to this item.
Image ( ) Get the buyable image.
QuantityField ( ) : ShopQuantityField
Total ( ) Get calculated total, or stored total depending on whether the order is in cart
UnitPrice ( ) Get unit price for this item.
addLink ( ) : string
onBeforeWrite ( ) Recalculate total before saving to database.
onPayment ( ) * Event handler called when an order is fully paid for.
onPlacement ( ) Event handlier called for last time saving/processing, before item permanently stored in database.
removeLink ( ) : string
removeallLink ( ) : string
setQuantity ( integer $val ) Prevent quantity being below 1.
setUnitPrice ( $val ) Prevent unit price ever being below 0
setquantityLink ( ) : string
uniquedata ( ) Intersects this item's required_fields with the data record.

보호된 메소드들

메소드 설명
calculatetotal ( ) Calculates the total for this item.

메소드 상세

Buyable() 공개 메소드

Get the buyable object related to this item.
public Buyable ( )

Image() 공개 메소드

Also serves as a standardised placeholder for overriding in subclasses.
public Image ( )

QuantityField() 공개 메소드

public QuantityField ( ) : ShopQuantityField
리턴 ShopQuantityField

Total() 공개 메소드

Get calculated total, or stored total depending on whether the order is in cart
public Total ( )

UnitPrice() 공개 메소드

Fetches from db, or Buyable, based on order status.
public UnitPrice ( )

calculatetotal() 보호된 메소드

Generally called by onBeforeWrite
protected calculatetotal ( )

onBeforeWrite() 공개 메소드

Recalculate total before saving to database.
public onBeforeWrite ( )

onPayment() 공개 메소드

* Event handler called when an order is fully paid for.
public onPayment ( )

onPlacement() 공개 메소드

This should only be called when order is transformed from Cart to Order, aka being 'placed'.
public onPlacement ( )

setQuantity() 공개 메소드

0 quantity means it should instead be deleted.
public setQuantity ( integer $val )
$val integer new quantity to set

setUnitPrice() 공개 메소드

Prevent unit price ever being below 0
public setUnitPrice ( $val )

uniquedata() 공개 메소드

This is used for uniquely adding items to the cart.
public uniquedata ( )