PHP Class Sonata\OrderBundle\Entity\BaseOrderElement

Inheritance: implements Sonata\Component\Order\OrderElementInterface
Show file Open project: sonata-project/ecommerce

Protected Properties

Property Type Description
$createdAt
$deliveryStatus integer
$description string
$designation string
$options array
$order integer
$price float
$product Sonata\Component\Product\ProductInterface
$productId integer
$productType string
$quantity integer
$rawProduct array
$status integer
$unitPriceExcl float
$unitPriceInc float
$updatedAt
$validatedAt DateTime
$vatRate float

Public Methods

Method Description
__construct ( )
__toString ( ) : string
getCreatedAt ( ) : DateTime
getDeliveryStatus ( ) : integer Get delivery_status.
getDeliveryStatusList ( ) : array
getDeliveryStatusName ( ) : string
getDescription ( ) : string Get description.
getDesignation ( ) : string Get designation.
getOption ( string $name, mixed $default = null ) : mixed
getOptions ( ) : array
getOrder ( ) : Order Get order.
getPrice ( $vat = false )
getProduct ( ) : Sonata\Component\Product\ProductInterface Get product.
getProductId ( ) : integer Get productId.
getProductType ( ) : string Get product_type.
getQuantity ( )
getRawProduct ( ) : array
getRawProductValue ( string $name, string $default = null ) : mixed
getStatus ( ) : integer Get status.
getStatusList ( ) : array
getStatusName ( ) : string
getTotal ( boolean $vat = false ) : float Return the total (price * quantity).
getTotalWithVat ( ) : float Returns the total with vat due to limitation of AdminBundle.
getUnitPrice ( $vat = false )
getUnitPriceExcl ( ) : float Returns unit price including VAT.
getUnitPriceInc ( ) : float Returns unit price including VAT.
getUpdatedAt ( ) : DateTime
getValidatedAt ( ) : DateTime Get validated_at.
getVatAmount ( ) : float Returns VAT element amount.
getVatRate ( )
hasOption ( string $name ) : boolean
isCancellable ( ) : boolean
isCancelled ( ) : boolean
isError ( ) : boolean Return true if the order has an error.
isOpen ( ) : boolean Return true if the order is open.
isPending ( ) : boolean
isValidated ( ) : boolean return true if the order is validated.
prePersist ( )
preUpdate ( )
setCreatedAt ( DateTime $createdAt = null )
setDeliveryStatus ( integer $deliveryStatus ) Set delivery_status.
setDescription ( string $description ) Set description.
setDesignation ( string $designation ) Set designation.
setOption ( string $name, mixed $value )
setOptions ( array $options )
setOrder ( Sonata\Component\Order\OrderInterface $order ) Set order.
setPrice ( $price )
setProduct ( Sonata\Component\Product\ProductInterface $product ) Add product.
setProductId ( integer $productId ) Set productId.
setProductType ( string $productType ) Set product_type.
setQuantity ( $quantity )
setRawProduct ( array $rawProduct )
setStatus ( integer $status ) Set status.
setUnitPriceExcl ( float $unitPriceExcl ) Sets unit price excluding VAT.
setUnitPriceInc ( float $unitPriceInc ) Sets unit price including VAT.
setUpdatedAt ( DateTime $updatedAt = null )
setValidatedAt ( DateTime $validatedAt = null ) Set validated_at.
setVatRate ( $vatRate )

Method Details

__construct() public method

public __construct ( )

__toString() public method

public __toString ( ) : string
return string

getCreatedAt() public method

public getCreatedAt ( ) : DateTime
return DateTime

getDeliveryStatus() public method

Get delivery_status.
public getDeliveryStatus ( ) : integer
return integer $deliveryStatus

getDeliveryStatusList() public static method

public static getDeliveryStatusList ( ) : array
return array

getDeliveryStatusName() public method

public getDeliveryStatusName ( ) : string
return string

getDescription() public method

Get description.
public getDescription ( ) : string
return string $description

getDesignation() public method

Get designation.
public getDesignation ( ) : string
return string $designation

getOption() public method

public getOption ( string $name, mixed $default = null ) : mixed
$name string
$default mixed
return mixed

getOptions() public method

public getOptions ( ) : array
return array

getOrder() public method

Get order.
public getOrder ( ) : Order
return Order $order

getPrice() public method

public getPrice ( $vat = false )

getProduct() public method

Get product.
public getProduct ( ) : Sonata\Component\Product\ProductInterface
return Sonata\Component\Product\ProductInterface $product

getProductId() public method

Get productId.
public getProductId ( ) : integer
return integer $productId

getProductType() public method

Get product_type.
public getProductType ( ) : string
return string $productType

getQuantity() public method

public getQuantity ( )

getRawProduct() public method

public getRawProduct ( ) : array
return array

getRawProductValue() public method

public getRawProductValue ( string $name, string $default = null ) : mixed
$name string
$default string
return mixed

getStatus() public method

Get status.
public getStatus ( ) : integer
return integer $status

getStatusList() public static method

public static getStatusList ( ) : array
return array

getStatusName() public method

public getStatusName ( ) : string
return string

getTotal() public method

if $vat = true, return the price with vat
public getTotal ( boolean $vat = false ) : float
$vat boolean
return float

getTotalWithVat() public method

Returns the total with vat due to limitation of AdminBundle.
public getTotalWithVat ( ) : float
return float

getUnitPrice() public method

public getUnitPrice ( $vat = false )

getUnitPriceExcl() public method

Returns unit price including VAT.
public getUnitPriceExcl ( ) : float
return float

getUnitPriceInc() public method

Returns unit price including VAT.
public getUnitPriceInc ( ) : float
return float

getUpdatedAt() public method

public getUpdatedAt ( ) : DateTime
return DateTime

getValidatedAt() public method

Get validated_at.
public getValidatedAt ( ) : DateTime
return DateTime $validatedAt

getVatAmount() public method

Returns VAT element amount.
public getVatAmount ( ) : float
return float

getVatRate() public method

public getVatRate ( )

hasOption() public method

public hasOption ( string $name ) : boolean
$name string
return boolean

isCancellable() public method

public isCancellable ( ) : boolean
return boolean

isCancelled() public method

public isCancelled ( ) : boolean
return boolean true if cancelled, else false

isError() public method

Return true if the order has an error.
public isError ( ) : boolean
return boolean

isOpen() public method

Return true if the order is open.
public isOpen ( ) : boolean
return boolean

isPending() public method

public isPending ( ) : boolean
return boolean true if pending, else false

isValidated() public method

return true if the order is validated.
public isValidated ( ) : boolean
return boolean

prePersist() public method

public prePersist ( )

preUpdate() public method

public preUpdate ( )

setCreatedAt() public method

public setCreatedAt ( DateTime $createdAt = null )
$createdAt DateTime

setDeliveryStatus() public method

Set delivery_status.
public setDeliveryStatus ( integer $deliveryStatus )
$deliveryStatus integer

setDescription() public method

Set description.
public setDescription ( string $description )
$description string

setDesignation() public method

Set designation.
public setDesignation ( string $designation )
$designation string

setOption() public method

public setOption ( string $name, mixed $value )
$name string
$value mixed

setOptions() public method

public setOptions ( array $options )
$options array

setOrder() public method

Set order.
public setOrder ( Sonata\Component\Order\OrderInterface $order )
$order Sonata\Component\Order\OrderInterface

setPrice() public method

public setPrice ( $price )

setProduct() public method

Add product.
public setProduct ( Sonata\Component\Product\ProductInterface $product )
$product Sonata\Component\Product\ProductInterface

setProductId() public method

Set productId.
public setProductId ( integer $productId )
$productId integer

setProductType() public method

Set product_type.
public setProductType ( string $productType )
$productType string

setQuantity() public method

public setQuantity ( $quantity )

setRawProduct() public method

public setRawProduct ( array $rawProduct )
$rawProduct array

setStatus() public method

Set status.
public setStatus ( integer $status )
$status integer

setUnitPriceExcl() public method

Sets unit price excluding VAT.
public setUnitPriceExcl ( float $unitPriceExcl )
$unitPriceExcl float

setUnitPriceInc() public method

Sets unit price including VAT.
public setUnitPriceInc ( float $unitPriceInc )
$unitPriceInc float

setUpdatedAt() public method

public setUpdatedAt ( DateTime $updatedAt = null )
$updatedAt DateTime

setValidatedAt() public method

Set validated_at.
public setValidatedAt ( DateTime $validatedAt = null )
$validatedAt DateTime

setVatRate() public method

public setVatRate ( $vatRate )

Property Details

$createdAt protected property

protected $createdAt

$deliveryStatus protected property

protected int $deliveryStatus
return integer

$description protected property

protected string $description
return string

$designation protected property

protected string $designation
return string

$options protected property

protected array $options
return array

$order protected property

protected int $order
return integer

$price protected property

protected float $price
return float

$product protected property

protected ProductInterface,Sonata\Component\Product $product
return Sonata\Component\Product\ProductInterface

$productId protected property

protected int $productId
return integer

$productType protected property

protected string $productType
return string

$quantity protected property

protected int $quantity
return integer

$rawProduct protected property

protected array $rawProduct
return array

$status protected property

protected int $status
return integer

$unitPriceExcl protected property

protected float $unitPriceExcl
return float

$unitPriceInc protected property

protected float $unitPriceInc
return float

$updatedAt protected property

protected $updatedAt

$validatedAt protected property

protected DateTime $validatedAt
return DateTime

$vatRate protected property

protected float $vatRate
return float