ZenMagick 0.9.10


zenmagick.store.shared.model.catalog\ZMAttributeValue
model\catalog\ZMAttributeValue.php at line 36

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

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct(int id, mixed name)

Create new instance.

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
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

model\catalog\ZMAttributeValue.php at line 58

__construct

public void __construct(int id, mixed name)

Create new instance.


model\catalog\ZMAttributeValue.php at line 85

getAttribute

public ZMAttribute getAttribute()

Get the parent attribute.

Returns:
The attribute.

model\catalog\ZMAttributeValue.php at line 201

getFinalOneTimePriceForQty

protected float getFinalOneTimePriceForQty(int quantity)

Get the final one time attribute price.

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

model\catalog\ZMAttributeValue.php at line 154

getFinalPriceForQty

protected float getFinalPriceForQty(int quantity)

Get the final attribute price without discount.

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

model\catalog\ZMAttributeValue.php at line 78

getId

public int getId()

Get the attribute value id.

Returns:
The attribute value id.

model\catalog\ZMAttributeValue.php at line 302

getImage

public string getImage()

Get the attribute value image (if any).

Returns:
The attribute value image name.

model\catalog\ZMAttributeValue.php at line 92

getName

public string getName()

Get the attribute value name.

Returns:
The attribute value name.

model\catalog\ZMAttributeValue.php at line 224

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.

model\catalog\ZMAttributeValue.php at line 180

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.

model\catalog\ZMAttributeValue.php at line 140

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.

model\catalog\ZMAttributeValue.php at line 239

getPricePrefix

public string getPricePrefix()

Get the price prefix.

Returns:
The price prefix.

model\catalog\ZMAttributeValue.php at line 111

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.

model\catalog\ZMAttributeValue.php at line 437

getSortOrder

public int getSortOrder()

Get the attribute value sort order.

Returns:
The attribute sort order.

model\catalog\ZMAttributeValue.php at line 316

getTaxRate

public ZMTaxRate getTaxRate()

Get the tax rate.

Returns:
The tax rate.

model\catalog\ZMAttributeValue.php at line 100

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.

model\catalog\ZMAttributeValue.php at line 253

getWeight

public double getWeight()

Get the attribute weight.

Returns:
The attribute weight.

model\catalog\ZMAttributeValue.php at line 260

getWeightPrefix

public string getWeightPrefix()

Get the weight prefix.

Returns:
The weight prefix.

model\catalog\ZMAttributeValue.php at line 288

hasImage

public boolean hasImage()

Check if this value has an associated image.

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

model\catalog\ZMAttributeValue.php at line 274

isDefault

public boolean isDefault()

Check if this is the default value.

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

model\catalog\ZMAttributeValue.php at line 281

isDiscounted

public boolean isDiscounted()

Check if this value is discounted.

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

model\catalog\ZMAttributeValue.php at line 267

isDisplayOnly

public boolean isDisplayOnly()

Check if the attribute is 'display only'.

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

model\catalog\ZMAttributeValue.php at line 246

isFree

public boolean isFree()

Check if the attribute is free.

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

model\catalog\ZMAttributeValue.php at line 295

isIncludeInBasePrice

public boolean isIncludeInBasePrice()

Check if the base price is included.

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

model\catalog\ZMAttributeValue.php at line 309

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.

model\catalog\ZMAttributeValue.php at line 330

setAttribute

public void setAttribute(ZMAttribute attribute)

Set the parent attribute.

Parameters:
attribute - The attribute.

model\catalog\ZMAttributeValue.php at line 395

setDefault

public void setDefault(boolean value)

Set the default value flag.

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

model\catalog\ZMAttributeValue.php at line 402

setDiscounted

public void setDiscounted(boolean value)

Set the is discounted flag.

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

model\catalog\ZMAttributeValue.php at line 388

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.

model\catalog\ZMAttributeValue.php at line 367

setFree

public void setFree(boolean value)

Sheck the attribute free flag.

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

model\catalog\ZMAttributeValue.php at line 323

setId

public void setId(int id)

Set the attribute value id.

Parameters:
id - The attribute value id.

model\catalog\ZMAttributeValue.php at line 409

setImage

public void setImage(string image)

Set the attribute value image (if any).

Parameters:
image - The attribute value image name.

model\catalog\ZMAttributeValue.php at line 423

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.

model\catalog\ZMAttributeValue.php at line 337

setName

public void setName(string name)

Set the attribute value name.

Parameters:
name - The attribute value name.

model\catalog\ZMAttributeValue.php at line 353

setOneTimePrice

public void setOneTimePrice(double oneTimePrice)

Set the values one time price.

Parameters:
oneTimePrice - The attributes one time price.

model\catalog\ZMAttributeValue.php at line 416

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.

model\catalog\ZMAttributeValue.php at line 360

setPricePrefix

public void setPricePrefix(string pricePrefix)

Set the price prefix.

Parameters:
pricePrefix - The price prefix.

model\catalog\ZMAttributeValue.php at line 444

setSortOrder

public void setSortOrder(int sortOrder)

Set the attribute value sort order.

Parameters:
sortOrder - The attribute sort order.

model\catalog\ZMAttributeValue.php at line 430

setTaxRate

public void setTaxRate(ZMTaxRate taxRate)

Set the tax rate.

Parameters:
taxRate - The tax rate.

model\catalog\ZMAttributeValue.php at line 344

setValuePrice

public void setValuePrice(double price)

Set the value price.

Parameters:
price - The price.

model\catalog\ZMAttributeValue.php at line 374

setWeight

public double setWeight(mixed weight)

Set the attribute weight.

Returns:
weight The attribute weight.

model\catalog\ZMAttributeValue.php at line 381

setWeightPrefix

public void setWeightPrefix(string weightPrefix)

Set the weight prefix.

Parameters:
weightPrefix - The weight prefix.

ZenMagick 0.9.10