Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZOptionValue Class Reference

## Public Member Functions
| __construct ( $id=-1)
| store ()
| get ( $id=-1)
& | getAll ()
& | getByOption (&$value, $as_object=true)
| setTotalQuantity ( $quantity)
& | descriptions ( $id=false)
| removeDescriptions ( $id=false)
| addDescription ( $description, $id=false)
| delete ( $id=false)
| getByRemoteID ( $id)
| id ()
| price ()
& | localePrice ( $calcVAT, $inProduct)
| correctPrice ( $calcVAT, $inProduct, $withPriceGroups=true)
& | localeSavings ( $calcVAT, $inProduct)
| correctSavings ( $calcVAT, $inProduct)
| remoteID ()
| option ()
| setPrice ( $value)
| setRemoteID ( $value)
| setOptionID ( $value)

## Static Public Member Functions
| totalQuantity ( $id=false)
| hasQuantity ( $require=true, $id=false)

## Public Attributes
| $ID
| $Price
| $RemoteID
| $OptionID

## Detailed Description

! eZTrade Handles product option values.

Example:

// Create a new eZOptionValue object and store it to the database
$value = new eZOptionValue();
$value->setName( "Red" );
$value->store();
// Fetch a value from the database, and print out the contents.
$value->get( 2 );
print( $value->name() );
eZOptionValue
Definition: ezoptionvalue.php:54

See also
  eZProductCategory eZOption

Definition at line 53 of file ezoptionvalue.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZOptionValue::__construct | ( |  | $id = `-1` | ) |

Constructs a new eZOptionValue object.

Definition at line 58 of file ezoptionvalue.php.

References $id, and $ID.

## Member Function Documentation

## ◆ addDescription()

eZOptionValue::addDescription | ( |  | $description,
|  |  | $id = `false`
| ) |  |

Adds a new description to this option value.

Definition at line 326 of file ezoptionvalue.php.

References $db, $desc, $id, $ID, $ret, eZDB\finish(), and eZDB\globalDatabase().

## ◆ correctPrice()

eZOptionValue::correctPrice | ( |  | $calcVAT,
|  |  | $inProduct,
|  |  | $withPriceGroups = `true`
| ) |  |

Returns the correct price of the option value.

Definition at line 437 of file ezoptionvalue.php.

References $groups, $price, $Price, $vat, eZPriceGroup\correctPrice(), eZUser\currentUser(), and eZPriceGroup\priceGroups().

Referenced by localePrice().

## ◆ correctSavings()

eZOptionValue::correctSavings | ( |  | $calcVAT,
|  |  | $inProduct
| ) |  |

Returns the savings of the option value.

Definition at line 497 of file ezoptionvalue.php.

References $groups, $price, $Price, $vat, eZPriceGroup\correctPrice(), eZUser\currentUser(), and eZPriceGroup\priceGroups().

Referenced by localeSavings().

## ◆ delete()

eZOptionValue::delete | ( |  | $id = `false` | ) |

Deletes a option from the database.

Definition at line 363 of file ezoptionvalue.php.

References $db, $id, $ID, $ret, eZDB\finish(), and eZDB\globalDatabase().

Referenced by eZOption\removeValue().

## ◆ descriptions()

& eZOptionValue::descriptions | ( |  | $id = `false` | ) |

Returns all descriptions connected to this option value. It is returned as an array with strings.

Definition at line 294 of file ezoptionvalue.php.

References $db, $id, $ID, $ret, $row, and eZDB\globalDatabase().

## ◆ get()

eZOptionValue::get | ( |  | $id = `-1` | ) |

Fetches the option object values from the database.

Definition at line 124 of file ezoptionvalue.php.

References $db, $id, and eZDB\globalDatabase().

## ◆ getAll()

& eZOptionValue::getAll | ( |  | ) |

Returns every optionValue stored in the database.

Definition at line 150 of file ezoptionvalue.php.

References $db, $i, and eZDB\globalDatabase().

## ◆ getByOption()

& eZOptionValue::getByOption | ( | & | $value,
|  |  | $as_object = `true`
| ) |  |

Returns every optionValue connected to a certain Option.

The values are sorted by name. Returns 0 if no values are found.

Definition at line 172 of file ezoptionvalue.php.

References $db, $i, $id, and eZDB\globalDatabase().

## ◆ getByRemoteID()

eZOptionValue::getByRemoteID | ( |  | $id | ) |

Check if there are a value where RemoteID == $id. Return the value if true.

Definition at line 383 of file ezoptionvalue.php.

References $db, $res, and eZDB\globalDatabase().

Referenced by eZFreeTradeImport\makeLinks().

## ◆ hasQuantity()

eZOptionValue::hasQuantity | ( |  | $require = `true`,
|  |  | $id = `false`
| ) |  |
| static

Returns true if the option value has some sort of quantity which can be bought.

Definition at line 279 of file ezoptionvalue.php.

References $id, $ID, and totalQuantity().

## ◆ id()

eZOptionValue::id | ( |  | ) |

Returns the id of the optionvalue.

Definition at line 404 of file ezoptionvalue.php.

References $ID.

## ◆ localePrice()

& eZOptionValue::localePrice | ( |  | $calcVAT,
|  |  | $inProduct
| ) |  |

Returns the correct localized price of the product.

Definition at line 420 of file ezoptionvalue.php.

References $currency, $ini, $locale, $price, and correctPrice().

## ◆ localeSavings()

& eZOptionValue::localeSavings | ( |  | $calcVAT,
|  |  | $inProduct
| ) |  |

Returns the correct localized savings of the product.

Definition at line 479 of file ezoptionvalue.php.

References $currency, $ini, $locale, $price, and correctSavings().

## ◆ option()

eZOptionValue::option | ( |  | ) |

Returns the option connected to the value.

Definition at line 558 of file ezoptionvalue.php.

## ◆ price()

eZOptionValue::price | ( |  | ) |

Returns the price of the option value.

Definition at line 412 of file ezoptionvalue.php.

References $Price.

## ◆ remoteID()

eZOptionValue::remoteID | ( |  | ) |

Returns the remoteID of the option value.

Definition at line 550 of file ezoptionvalue.php.

References $RemoteID.

## ◆ removeDescriptions()

eZOptionValue::removeDescriptions | ( |  | $id = `false` | ) |

Removes all descriptions for this option value.

Definition at line 313 of file ezoptionvalue.php.

References $db, $id, $ID, $ret, eZDB\finish(), and eZDB\globalDatabase().

## ◆ setOptionID()

eZOptionValue::setOptionID | ( |  | $value | ) |

Definition at line 582 of file ezoptionvalue.php.

## ◆ setPrice()

eZOptionValue::setPrice | ( |  | $value | ) |

Sets the price of the option value.

Definition at line 566 of file ezoptionvalue.php.

## ◆ setRemoteID()

eZOptionValue::setRemoteID | ( |  | $value | ) |

Sets the remoteID of the option value.

Definition at line 574 of file ezoptionvalue.php.

## ◆ setTotalQuantity()

eZOptionValue::setTotalQuantity | ( |  | $quantity | ) |

Sets the total quantity of the option value.

Definition at line 201 of file ezoptionvalue.php.

References $db, $id, $ID, $ret, $row, eZDB\finish(), and eZDB\globalDatabase().

## ◆ store()

eZOptionValue::store | ( |  | ) |

Stores a eZOptionValue object to the database.

Definition at line 70 of file ezoptionvalue.php.

References $db, $ini, $price, $ret, eZDB\finish(), and eZDB\globalDatabase().

## ◆ totalQuantity()

eZOptionValue::totalQuantity | ( |  | $id = `false` | ) |
| static

Returns the total quantity of this value.

Definition at line 251 of file ezoptionvalue.php.

References $db, $id, $ID, $row, and eZDB\globalDatabase().

Referenced by hasQuantity().

## Member Data Documentation

## ◆ $ID

eZOptionValue::$ID

Definition at line 588 of file ezoptionvalue.php.

Referenced by __construct(), addDescription(), delete(), descriptions(), hasQuantity(), id(), removeDescriptions(), setTotalQuantity(), and totalQuantity().

## ◆ $OptionID

eZOptionValue::$OptionID

Definition at line 591 of file ezoptionvalue.php.

## ◆ $Price

eZOptionValue::$Price

Definition at line 589 of file ezoptionvalue.php.

Referenced by correctPrice(), correctSavings(), and price().

## ◆ $RemoteID

eZOptionValue::$RemoteID

Definition at line 590 of file ezoptionvalue.php.

Referenced by remoteID().

The documentation for this class was generated from the following file:

- ezoptionvalue.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.