class Product extends Base

Class Product

Constants

OUT_OF_STOCK_DENY

OUTOFSTOCK_DENY denies order of product if out-of-stock.

OUT_OF_STOCK_ALLOW

OUTOFSTOCK_ALLOW allows order of product if out-of-stock.

OUT_OF_STOCK_DEFAULT

OUTOFSTOCK_DEFAULT Default behaviour for out of stock.

Properties

static string $pimcoreClass Pimcore Object Class.
static string $staticRoute
static bool $unitTests

Methods

static  string
getPimcoreObjectClass()

get Pimcore implementation class.

from Base
static  Base
create()

Create new instance of Pimcore Object.

from Base
static  int
classId()

returns the class ID of the current object class.

from Base
static  Listing
getList( array $config = array())

No description

from Base
static  Data[]
getMandatoryFields()

No description

from Base
static 
validate($data)

No description

from Base
static  mixed|null
__callStatic($method, $arguments)

No description

from Base
array
toArray()

Object to Array.

from Base
string
getCacheKey()

get cache key

from Base
AdminStyle
getElementAdminStyle()

Admin Element Style.

from Base
save()

No description

from Base
Note
createNote($type)

Create a note for this object.

from Base
AbstractObject
getVariantMaster()

Return Topmost Master if Object is Variant

from Base
bool
isAllowedForShop( Shop $shop)

No description

from Base
bool|string
getUrl($language, $params = array(), $route, bool $reset = false, Shop $shop = null)

No description

from Base
static  null|Product
getById( int $id)

No description

static  array
getAll()

Get all Products.

static  array|mixed
getLatest( int $limit = 8)

Get latest Products.

static  string
getPriceCacheTag( Product $product)

get price cache tag for product-id

bool|Asset
getImage()

Get Image for Product.

bool|Asset
getDefaultImage()

Get default Image for Product.

bool
getIsNew()

Get Product is new.

bool
inCategory( Category $category)

Check if Product is in Categry.

array|boolean
getVariantDifferences($language = null, $type = 'objectbricks', $field = 'variants')

Get all Variants Differences.

clearPriceCache()

Clear Cache for this Product Price

getValidSpecificPriceRules()

get all valid specific price riles

float|boolean
getSpecificPrice()

Get Specific Price.

float
getDiscount()

Get Discount from Specific Prices.

float
getSalesPrice( bool $withTax = true)

Get Sales Price (without discounts), with or without taxes

float
getRetailPriceWithTax()

Get retail price with tax

float
getRetailPriceWithoutTax()

Get retail price without tax

float|mixed
getPrice( boolean $withTax = true, boolean $doCurrencyConvert = true)

Get Product Price with Tax.

bool|float
getMinPrice()

get possible min price of Product according to price-rules

bool|float
getMaxPrice()

get possible max price of Product according to price-rules

bool|float
getMinMaxPrice( string $operator = '<')

get possible min/max price of Product according to price-rules

float|mixed
getCheapestVariantPrice()

returns variant with cheapest price.

float
getTaxRate()

Get Tax Rate.

float|array
getTaxAmount( bool $asArray = false)

Get Product Tax Amount.

getTaxCalculator( Address $address = null)

get TaxCalculator.

updateQuantity($delta)

Adds $delta to current Quantity.

bool
isAvailableWhenOutOfStock()

Is Available when out-of-stock.

SpecificPrice[]|null
getSpecificPrices()

get all specific prices.

float
getCheapestDeliveryPrice()

get cheapest delivery price for product.

bool|string
getProductUrl($language, bool $reset = false, Shop $shop = null)

get url for product -> returns false if the product is not available for the shop

__sleep()

No description

bool
getDoIndex()

Determines if product should be indexed.

string
getEan()

No description

setEan( string $ean)

No description

string
getArticleNumber()

No description

setArticleNumber( string $articleNumber)

No description

boolean
getEnabled()

No description

setEnabled( boolean $enabled)

No description

boolean
getAvailableForOrder()

No description

setAvailableForOrder( boolean $availableForOrder)

No description

boolean
getisVirtualProduct()

No description

setIsVirtualProduct( boolean $isVirtualProduct)

No description

getManufacturer()

No description

setManufacturer( Manufacturer|int $manufacturer)

No description

int[]
getShops()

No description

setShops( int[] $shops)

No description

getCategories()

No description

setCategories( Category[] $categories)

No description

double
getWholesalePrice()

No description

setWholesalePrice( double $wholesalePrice)

No description

double
getRetailPrice()

No description

setRetailPrice( double $retailPrice)

No description

TaxRule|null
getTaxRule()

No description

setTaxRule( TaxRuleGroup $taxRule)

No description

int
getQuantity()

No description

setQuantity( int $quantity)

No description

int
getOutOfStockBehaviour()

No description

setOutOfStockBehaviour( int $outOfStockBehaviour)

No description

float
getDepth()

No description

setDepth( float $depth)

No description

mixed
getWidth()

No description

setWidth( float $width)

No description

float
getHeight()

No description

setHeight( float $height)

No description

float
getWeight()

No description

setWeight( float $weight)

No description

Asset[]
getImages()

No description

setImages( Asset[] $images)

No description

mixed
getCustomProperties()

No description

setCustomProperties( mixed $customProperties)

No description

mixed
getVariants()

No description

setVariants( mixed $variants)

No description

mixed
getClassificationStore()

No description

setClassificationStore( mixed $classificationStore)

No description

Asset
getVirtualAsset()

No description

setVirtualAsset( Asset $virtualAsset)

No description

Details

in Base at line line 50
static string getPimcoreObjectClass()

get Pimcore implementation class.

Return Value

string

Exceptions

Exception

in Base at line line 68
static Base create()

Create new instance of Pimcore Object.

Return Value

Base

Exceptions

Exception

in Base at line line 84
static int classId()

returns the class ID of the current object class.

Return Value

int

in Base at line line 98
static Listing getList( array $config = array())

Parameters

array $config

Return Value

Listing

Exceptions

Exception

in Base at line line 131
static Data[] getMandatoryFields()

Return Value

Data[]

Exceptions

Exception

in Base at line line 156
static validate($data)

Parameters

$data

Exceptions

ValidationException

in Base at line line 173
static mixed|null __callStatic($method, $arguments)

Parameters

$method
$arguments

Return Value

mixed|null

Exceptions

Exception

in Base at line line 194
array toArray()

Object to Array.

Return Value

array

in Base at line line 204
string getCacheKey()

get cache key

Return Value

string

in Base at line line 224
AdminStyle getElementAdminStyle()

Admin Element Style.

Return Value

AdminStyle

in Base at line line 247
Base save()

Return Value

Base

Exceptions

Exception
Exception
ValidationException

in Base at line line 267
Note createNote($type)

Create a note for this object.

Parameters

$type string

Return Value

Note $note

in Base at line line 289
AbstractObject getVariantMaster()

Return Topmost Master if Object is Variant

Return Value

AbstractObject

in Base at line line 304
bool isAllowedForShop( Shop $shop)

Parameters

Shop $shop

Return Value

bool

in Base at line line 323
bool|string getUrl($language, $params = array(), $route, bool $reset = false, Shop $shop = null)

Parameters

$language
$params
$route
bool $reset
Shop $shop

Return Value

bool|string

at line line 115
static null|Product getById( int $id)

Parameters

int $id

Return Value

null|Product

at line line 131
static array getAll()

Get all Products.

Return Value

array

at line line 146
static array|mixed getLatest( int $limit = 8)

Get latest Products.

Parameters

int $limit

Return Value

array|mixed

at line line 172
static string getPriceCacheTag( Product $product)

get price cache tag for product-id

Parameters

Product $product

Return Value

string

at line line 182
bool|Asset getImage()

Get Image for Product.

Return Value

bool|Asset

at line line 196
bool|Asset getDefaultImage()

Get default Image for Product.

Return Value

bool|Asset

at line line 216
bool getIsNew()

Get Product is new.

Return Value

bool

at line line 242
bool inCategory( Category $category)

Check if Product is in Categry.

Parameters

Category $category

Return Value

bool

at line line 262
array|boolean getVariantDifferences($language = null, $type = 'objectbricks', $field = 'variants')

Get all Variants Differences.

Parameters

$language
$type
$field

Return Value

array|boolean

at line line 290
clearPriceCache()

Clear Cache for this Product Price

at line line 300
SpecificPrice[] getValidSpecificPriceRules()

get all valid specific price riles

Return Value

SpecificPrice[]

at line line 339
float|boolean getSpecificPrice()

Get Specific Price.

Return Value

float|boolean

at line line 362
float getDiscount()

Get Discount from Specific Prices.

Return Value

float

at line line 393
float getSalesPrice( bool $withTax = true)

Get Sales Price (without discounts), with or without taxes

Parameters

bool $withTax

Return Value

float

at line line 433
float getRetailPriceWithTax()

Get retail price with tax

Return Value

float

at line line 453
float getRetailPriceWithoutTax()

Get retail price without tax

Return Value

float

at line line 476
float|mixed getPrice( boolean $withTax = true, boolean $doCurrencyConvert = true)

Get Product Price with Tax.

Parameters

boolean $withTax
boolean $doCurrencyConvert

Return Value

float|mixed

at line line 503
bool|float getMinPrice()

get possible min price of Product according to price-rules

Return Value

bool|float

at line line 513
bool|float getMaxPrice()

get possible max price of Product according to price-rules

Return Value

bool|float

at line line 524
bool|float getMinMaxPrice( string $operator = '<')

get possible min/max price of Product according to price-rules

Parameters

string $operator

Return Value

bool|float

at line line 553
float|mixed getCheapestVariantPrice()

returns variant with cheapest price.

Return Value

float|mixed

at line line 589
float getTaxRate()

Get Tax Rate.

Return Value

float

at line line 607
float|array getTaxAmount( bool $asArray = false)

Get Product Tax Amount.

Parameters

bool $asArray

Return Value

float|array

at line line 625
bool|TaxCalculator getTaxCalculator( Address $address = null)

get TaxCalculator.

Parameters

Address $address

Return Value

bool|TaxCalculator

at line line 659
updateQuantity($delta)

Adds $delta to current Quantity.

Parameters

$delta

at line line 672
bool isAvailableWhenOutOfStock()

Is Available when out-of-stock.

Return Value

bool

Exceptions

ObjectUnsupportedException

at line line 692
SpecificPrice[]|null getSpecificPrices()

get all specific prices.

Return Value

SpecificPrice[]|null

at line line 702
float getCheapestDeliveryPrice()

get cheapest delivery price for product.

Return Value

float

at line line 729
bool|string getProductUrl($language, bool $reset = false, Shop $shop = null)

get url for product -> returns false if the product is not available for the shop

Parameters

$language
bool $reset
Shop $shop

Return Value

bool|string

at line line 737
__sleep()

at line line 758
bool getDoIndex()

Determines if product should be indexed.

Return Value

bool

at line line 768
string getEan()

Return Value

string

Exceptions

ObjectUnsupportedException

at line line 778
setEan( string $ean)

Parameters

string $ean

Exceptions

ObjectUnsupportedException

at line line 788
string getArticleNumber()

Return Value

string

Exceptions

ObjectUnsupportedException

at line line 798
setArticleNumber( string $articleNumber)

Parameters

string $articleNumber

Exceptions

ObjectUnsupportedException

at line line 808
boolean getEnabled()

Return Value

boolean

Exceptions

ObjectUnsupportedException

at line line 818
setEnabled( boolean $enabled)

Parameters

boolean $enabled

Exceptions

ObjectUnsupportedException

at line line 828
boolean getAvailableForOrder()

Return Value

boolean

Exceptions

ObjectUnsupportedException

at line line 838
setAvailableForOrder( boolean $availableForOrder)

Parameters

boolean $availableForOrder

Exceptions

ObjectUnsupportedException

at line line 848
boolean getisVirtualProduct()

Return Value

boolean

Exceptions

ObjectUnsupportedException

at line line 858
setIsVirtualProduct( boolean $isVirtualProduct)

Parameters

boolean $isVirtualProduct

Exceptions

ObjectUnsupportedException

at line line 868
Manufacturer|null getManufacturer()

Return Value

Manufacturer|null

Exceptions

ObjectUnsupportedException

at line line 878
setManufacturer( Manufacturer|int $manufacturer)

Parameters

Manufacturer|int $manufacturer

Exceptions

ObjectUnsupportedException

at line line 888
int[] getShops()

Return Value

int[]

Exceptions

ObjectUnsupportedException

at line line 898
setShops( int[] $shops)

Parameters

int[] $shops

Exceptions

ObjectUnsupportedException

at line line 908
Category[] getCategories()

Return Value

Category[]

Exceptions

ObjectUnsupportedException

at line line 918
setCategories( Category[] $categories)

Parameters

Category[] $categories

Exceptions

ObjectUnsupportedException

at line line 928
double getWholesalePrice()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 938
setWholesalePrice( double $wholesalePrice)

Parameters

double $wholesalePrice

Exceptions

ObjectUnsupportedException

at line line 948
double getRetailPrice()

Return Value

double

Exceptions

ObjectUnsupportedException

at line line 958
setRetailPrice( double $retailPrice)

Parameters

double $retailPrice

Exceptions

ObjectUnsupportedException

at line line 968
TaxRule|null getTaxRule()

Return Value

TaxRule|null mixed

Exceptions

ObjectUnsupportedException

at line line 978
setTaxRule( TaxRuleGroup $taxRule)

Parameters

TaxRuleGroup $taxRule

Exceptions

ObjectUnsupportedException

at line line 988
int getQuantity()

Return Value

int

Exceptions

ObjectUnsupportedException

at line line 998
setQuantity( int $quantity)

Parameters

int $quantity

Exceptions

ObjectUnsupportedException

at line line 1008
int getOutOfStockBehaviour()

Return Value

int

Exceptions

ObjectUnsupportedException

at line line 1018
setOutOfStockBehaviour( int $outOfStockBehaviour)

Parameters

int $outOfStockBehaviour

Exceptions

ObjectUnsupportedException

at line line 1028
float getDepth()

Return Value

float

Exceptions

ObjectUnsupportedException

at line line 1038
setDepth( float $depth)

Parameters

float $depth

Exceptions

ObjectUnsupportedException

at line line 1046
mixed getWidth()

Return Value

mixed

at line line 1056
setWidth( float $width)

Parameters

float $width

Exceptions

ObjectUnsupportedException

at line line 1066
float getHeight()

Return Value

float

Exceptions

ObjectUnsupportedException

at line line 1076
setHeight( float $height)

Parameters

float $height

Exceptions

ObjectUnsupportedException

at line line 1086
float getWeight()

Return Value

float

Exceptions

ObjectUnsupportedException

at line line 1096
setWeight( float $weight)

Parameters

float $weight

Exceptions

ObjectUnsupportedException

at line line 1106
Asset[] getImages()

Return Value

Asset[]

Exceptions

ObjectUnsupportedException

at line line 1116
setImages( Asset[] $images)

Parameters

Asset[] $images

Exceptions

ObjectUnsupportedException

at line line 1126
mixed getCustomProperties()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1136
setCustomProperties( mixed $customProperties)

Parameters

mixed $customProperties

Exceptions

ObjectUnsupportedException

at line line 1146
mixed getVariants()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1156
setVariants( mixed $variants)

Parameters

mixed $variants

Exceptions

ObjectUnsupportedException

at line line 1166
mixed getClassificationStore()

Return Value

mixed

Exceptions

ObjectUnsupportedException

at line line 1176
setClassificationStore( mixed $classificationStore)

Parameters

mixed $classificationStore

Exceptions

ObjectUnsupportedException

at line line 1186
Asset getVirtualAsset()

Return Value

Asset

Exceptions

ObjectUnsupportedException

at line line 1196
setVirtualAsset( Asset $virtualAsset)

Parameters

Asset $virtualAsset

Exceptions

ObjectUnsupportedException