ZenMagick 0.9.8


org.zenmagick.store.model.catalog.ZMAttributeValue
\store\model\catalog\ZMAttributeValue.php at line 39

Class ZMAttributeValue

ZMObject
└─ZMAttributeValue

public class ZMAttributeValue
extends ZMObject

A single attribute value.

For attributes that accept user input (text/upload), the name will be replaced with the entered data to allow handling all values the same way.

Author:
DerManoMann
Version:
$Id: ZMAttributeValue.php 2694 2009-12-03 22:32:18Z dermanomann $

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMAttributeValue(mixed id, mixed name)

Create new instance.

Method Summary
ZMAttribute

getAttribute()

Get the parent attribute.

protected float

getFinalOneTimePriceForQty(int quantity)

Get the final one time attribute price.

protected float

getFinalPriceForQty(int quantity)

Get the final attribute price without discount.

int

getId()

Get the attribute value id.

string

getImage()

Get the attribute value image (if any).

string

getName()

Get the attribute value name.

double

getOneTimePrice(boolean tax)

Get the final one time price.

double

getPrice(boolean tax, int quantity)

Get the final (and discounted) value price.

protected float

getPriceFactorCharge(float price, float discountPrice, float priceFactor, int priceFactorOffset)

Get the price factor charge.

string

getPricePrefix()

Get the price prefix.

protected float

getQtyPrice(string qtyPrices, int quantity)

Get one time charge (if any) for the given range and quantity.

int

getSortOrder()

Get the attribute value sort order.

ZMTaxRate

getTaxRate()

Get the tax rate.

double

getValuePrice(boolean tax)

Get the value price.

double

getWeight()

Get the attribute weight.

string

getWeightPrefix()

Get the weight prefix.

boolean

hasImage()

Check if this value has an associated image.

boolean

isDefault()

Check if this is the default value.

boolean

isDiscounted()

Check if this value is discounted.

boolean

isDisplayOnly()

Check if the attribute is 'display only'.

boolean

isFree()

Check if the attribute is free.

boolean

isIncludeInBasePrice()

Check if the base price is included.

boolean

isPriceFactorOneTime()

Check if the price factor is one time.

void

setAttribute(ZMAttribute attribute)

Set the parent attribute.

void

setDefault(boolean value)

Set the default value flag.

void

setDiscounted(boolean value)

Set the is discounted flag.

void

setDisplayOnly(boolean value)

Set the attribute is 'display only' flag.

void

setFree(boolean value)

Sheck the attribute free flag.

void

setId(int id)

Set the attribute value id.

void

setImage(string image)

Set the attribute value image (if any).

void

setIncludeInBasePrice(boolean value)

Set the base price is included flag.

void

setName(string name)

Set the attribute value name.

void

setOneTimePrice(double oneTimePrice)

Set the values one time price.

void

setPriceFactorOneTime(boolean value)

Set the price factor is one time flag.

void

setPricePrefix(string pricePrefix)

Set the price prefix.

void

setSortOrder(int sortOrder)

Set the attribute value sort order.

void

setTaxRate(ZMTaxRate taxRate)

Set the tax rate.

void

setValuePrice(double price)

Set the value price.

double

setWeight(mixed weight)

Set the attribute weight.

void

setWeightPrefix(string weightPrefix)

Set the weight prefix.

Methods inherited from org.zenmagick.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

\store\model\catalog\ZMAttributeValue.php at line 61

ZMAttributeValue

public ZMAttributeValue(mixed id, mixed name)

Create new instance.


Method Detail

\store\model\catalog\ZMAttributeValue.php at line 88

getAttribute

public ZMAttribute getAttribute()

Get the parent attribute.

Returns:
The attribute.

\store\model\catalog\ZMAttributeValue.php at line 204

getFinalOneTimePriceForQty

protected float getFinalOneTimePriceForQty(int quantity)

Get the final one time attribute price.

Parameters:
quantity - The quantity.
Returns:
The price.

\store\model\catalog\ZMAttributeValue.php at line 157

getFinalPriceForQty

protected float getFinalPriceForQty(int quantity)

Get the final attribute price without discount.

Parameters:
quantity - The quantity.
Returns:
The price.

\store\model\catalog\ZMAttributeValue.php at line 81

getId

public int getId()

Get the attribute value id.

Returns:
The attribute value id.

\store\model\catalog\ZMAttributeValue.php at line 305

getImage

public string getImage()

Get the attribute value image (if any).

Returns:
The attribute value image name.

\store\model\catalog\ZMAttributeValue.php at line 95

getName

public string getName()

Get the attribute value name.

Returns:
The attribute value name.

\store\model\catalog\ZMAttributeValue.php at line 227

getOneTimePrice

public double getOneTimePrice(boolean tax)

Get the final one time price.

Parameters:
tax - Set to true to include tax (if applicable); default is true.
Returns:
The attributes one time price.

\store\model\catalog\ZMAttributeValue.php at line 183

getPrice

public double getPrice(boolean tax, int quantity)

Get the final (and discounted) value price.

Parameters:
tax - Set to true to include tax (if applicable); default is true.
quantity - Optional quantity; default is 1.
Returns:
The price.

\store\model\catalog\ZMAttributeValue.php at line 143

getPriceFactorCharge

protected float getPriceFactorCharge(float price, float discountPrice, float priceFactor, int priceFactorOffset)

Get the price factor charge.

The setting 'isDiscountAttributePriceFactor' will determine whether to use the discount or regular price.

Parameters:
price - The calculated price.
discountPrice - The discounted price (if any).
priceFactor - The price factor.
priceFactorOffset - The price factopr offset.
Returns:
The price factor price.

\store\model\catalog\ZMAttributeValue.php at line 242

getPricePrefix

public string getPricePrefix()

Get the price prefix.

Returns:
The price prefix.

\store\model\catalog\ZMAttributeValue.php at line 114

getQtyPrice

protected float getQtyPrice(string qtyPrices, int quantity)

Get one time charge (if any) for the given range and quantity.

Parameters:
qtyPrices - The qty/price mappings.
quantity - The quantity.
Returns:
The one time charge.

\store\model\catalog\ZMAttributeValue.php at line 440

getSortOrder

public int getSortOrder()

Get the attribute value sort order.

Returns:
The attribute sort order.

\store\model\catalog\ZMAttributeValue.php at line 319

getTaxRate

public ZMTaxRate getTaxRate()

Get the tax rate.

Returns:
The tax rate.

\store\model\catalog\ZMAttributeValue.php at line 103

getValuePrice

public double getValuePrice(boolean tax)

Get the value price.

Parameters:
tax - Set to true to include tax (if applicable); default is true.
Returns:
The price.

\store\model\catalog\ZMAttributeValue.php at line 256

getWeight

public double getWeight()

Get the attribute weight.

Returns:
The attribute weight.

\store\model\catalog\ZMAttributeValue.php at line 263

getWeightPrefix

public string getWeightPrefix()

Get the weight prefix.

Returns:
The weight prefix.

\store\model\catalog\ZMAttributeValue.php at line 291

hasImage

public boolean hasImage()

Check if this value has an associated image.

Returns:
true if an image is available, false if not.

\store\model\catalog\ZMAttributeValue.php at line 277

isDefault

public boolean isDefault()

Check if this is the default value.

Returns:
true if this is the default value, false if not.

\store\model\catalog\ZMAttributeValue.php at line 284

isDiscounted

public boolean isDiscounted()

Check if this value is discounted.

Returns:
true if this value is discounted, false if not.

\store\model\catalog\ZMAttributeValue.php at line 270

isDisplayOnly

public boolean isDisplayOnly()

Check if the attribute is 'display only'.

Returns:
true if the value is display only, false if not.

\store\model\catalog\ZMAttributeValue.php at line 249

isFree

public boolean isFree()

Check if the attribute is free.

Returns:
true if the value is free, false if not.

\store\model\catalog\ZMAttributeValue.php at line 298

isIncludeInBasePrice

public boolean isIncludeInBasePrice()

Check if the base price is included.

Returns:
true if the base price is included, false if not.

\store\model\catalog\ZMAttributeValue.php at line 312

isPriceFactorOneTime

public boolean isPriceFactorOneTime()

Check if the price factor is one time.

Returns:
true if the price factor is one time only, false if not.

\store\model\catalog\ZMAttributeValue.php at line 333

setAttribute

public void setAttribute(ZMAttribute attribute)

Set the parent attribute.

Parameters:
attribute - The attribute.

\store\model\catalog\ZMAttributeValue.php at line 398

setDefault

public void setDefault(boolean value)

Set the default value flag.

Parameters:
value - true if this is the default value, false if not.

\store\model\catalog\ZMAttributeValue.php at line 405

setDiscounted

public void setDiscounted(boolean value)

Set the is discounted flag.

Parameters:
value - true if this value is discounted, false if not.

\store\model\catalog\ZMAttributeValue.php at line 391

setDisplayOnly

public void setDisplayOnly(boolean value)

Set the attribute is 'display only' flag.

Parameters:
value - true if the value is display only, false if not.

\store\model\catalog\ZMAttributeValue.php at line 370

setFree

public void setFree(boolean value)

Sheck the attribute free flag.

Parameters:
value - true if the value is free, false if not.

\store\model\catalog\ZMAttributeValue.php at line 326

setId

public void setId(int id)

Set the attribute value id.

Parameters:
id - The attribute value id.

\store\model\catalog\ZMAttributeValue.php at line 412

setImage

public void setImage(string image)

Set the attribute value image (if any).

Parameters:
image - The attribute value image name.

\store\model\catalog\ZMAttributeValue.php at line 426

setIncludeInBasePrice

public void setIncludeInBasePrice(boolean value)

Set the base price is included flag.

Parameters:
value - true if the base price is included, false if not.

\store\model\catalog\ZMAttributeValue.php at line 340

setName

public void setName(string name)

Set the attribute value name.

Parameters:
name - The attribute value name.

\store\model\catalog\ZMAttributeValue.php at line 356

setOneTimePrice

public void setOneTimePrice(double oneTimePrice)

Set the values one time price.

Parameters:
oneTimePrice - The attributes one time price.

\store\model\catalog\ZMAttributeValue.php at line 419

setPriceFactorOneTime

public void setPriceFactorOneTime(boolean value)

Set the price factor is one time flag.

Parameters:
value - true if the price factor is one time only, false if not.

\store\model\catalog\ZMAttributeValue.php at line 363

setPricePrefix

public void setPricePrefix(string pricePrefix)

Set the price prefix.

Parameters:
pricePrefix - The price prefix.

\store\model\catalog\ZMAttributeValue.php at line 447

setSortOrder

public void setSortOrder(int sortOrder)

Set the attribute value sort order.

Parameters:
sortOrder - The attribute sort order.

\store\model\catalog\ZMAttributeValue.php at line 433

setTaxRate

public void setTaxRate(ZMTaxRate taxRate)

Set the tax rate.

Parameters:
taxRate - The tax rate.

\store\model\catalog\ZMAttributeValue.php at line 347

setValuePrice

public void setValuePrice(double price)

Set the value price.

Parameters:
price - The price.

\store\model\catalog\ZMAttributeValue.php at line 377

setWeight

public double setWeight(mixed weight)

Set the attribute weight.

Returns:
weight The attribute weight.

\store\model\catalog\ZMAttributeValue.php at line 384

setWeightPrefix

public void setWeightPrefix(string weightPrefix)

Set the weight prefix.

Parameters:
weightPrefix - The weight prefix.

ZenMagick 0.9.8