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
eZVoucher Class Reference

## Public Member Functions
| __construct ( $id=-1)
| store ()
| delete ( $catID=-1)
| get ( $id=-1)
| fill (&$voucherArray)
| count ()
| id ()
& | created ()
| generateKey ( $length=15)
| keyNumber ()
& | user ( $asObject=true)
& | product ( $asObject=true)
| setAvailable ( $value)
| isAvailable ()
| setPrice ( $value)
| setTotalValue ( $value)
| setUser (&$user)
| setProduct (&$product)
& | price ()
& | totalValue ()
& | correctPrice ( $calcVAT)
| getFromKeyNumber (&$key, $available=true)
| getByUser (&$user, $available=true)
| information ()
| usedList ( $id=false)

## Static Public Member Functions
static & | getAll ( $offset=0, $limit=20)

## Public Attributes
| $ID
| $KeyNumber
| $Created
| $Available
| $Price
| $UserID
| $ProductID
| $TotalValue

## Detailed Description

! ezquizgame ezquizgame documentation.

Example code:

$voucher = new eZVoucher(); // Create a new object.
$voucher->setPrice( 500 ); // Sets the price of the voucher.
$voucher->generateKey(); // Genereate a uniqe key for the voucher.
$voucher->setMailMethod( 1 ); // Set the mail method, 1 is email and 2 is smail.
$voucher->setAvailable( true ); // Set that this voucher is available.
$voucher->setUser( eZUser::currentUser() ); // Sets the user that bought this voucher.
$voucher->store(); // Stores the object to the database.
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
eZVoucher
Definition: ezvoucher.php:54

See also
  eZVoucherUsed eZVoucherEMail eZVoucherSMail

Definition at line 53 of file ezvoucher.php.

## Constructor & Destructor Documentation

## ◆ __construct()

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

Constructs a new eZVoucher object.

If $id is set the object's values are fetched from the database.

Definition at line 62 of file ezvoucher.php.

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

## Member Function Documentation

## ◆ correctPrice()

& eZVoucher::correctPrice | ( |  | $calcVAT | ) |

Returns the correct price of the voucher based on the logged in user, and the VAT status and use.

Definition at line 382 of file ezvoucher.php.

References $price, $Price, $product, $vat, and product().

## ◆ count()

eZVoucher::count | ( |  | ) |

Returns the total count.

Definition at line 228 of file ezvoucher.php.

References $db, $result, $ret, and eZDB\globalDatabase().

Referenced by get(), and getAll().

## ◆ created()

& eZVoucher::created | ( |  | ) |

Returns the creation time of the voucher.

Definition at line 250 of file ezvoucher.php.

References $dateTime.

## ◆ delete()

eZVoucher::delete | ( |  | $catID = `-1` | ) |

Deletes a eZVoucher object from the database.

Definition at line 131 of file ezvoucher.php.

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

## ◆ fill()

eZVoucher::fill | ( | & | $voucherArray | ) |

Fills in information to the object taken from the array.

Definition at line 178 of file ezvoucher.php.

References $db, and eZDB\globalDatabase().

Referenced by __construct(), and get().

## ◆ generateKey()

eZVoucher::generateKey | ( |  | $length = `15` | ) |

Sets the login.

Definition at line 261 of file ezvoucher.php.

## ◆ get()

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

Fetches the object information from the database.

True is retuned if successful, false (0) if not.

Definition at line 152 of file ezvoucher.php.

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

## ◆ getAll()

static& eZVoucher::getAll | ( |  | $offset = `0`,
|  |  | $limit = `20`
| ) |  |
| static

Returns all the categories found in the database.

The categories are returned as an array of eZVoucher objects.

Definition at line 196 of file ezvoucher.php.

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

## ◆ getByUser()

eZVoucher::getByUser | ( | & | $user,
|  |  | $available = `true`
| ) |  |

Get a voucher from a key number.

Definition at line 451 of file ezvoucher.php.

References $db, $res, $result, $ret, $user, $userID, and eZDB\globalDatabase().

## ◆ getFromKeyNumber()

eZVoucher::getFromKeyNumber | ( | & | $key,
|  |  | $available = `true`
| ) |  |

Get a voucher from a key number.

Definition at line 428 of file ezvoucher.php.

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

## ◆ id()

eZVoucher::id | ( |  | ) |

Returns the object ID.

Definition at line 242 of file ezvoucher.php.

References $ID.

## ◆ information()

eZVoucher::information | ( |  | ) |

Return the voucher information.

Definition at line 474 of file ezvoucher.php.

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

## ◆ isAvailable()

eZVoucher::isAvailable | ( |  | ) |

Returns true if the voucher is avaiable

Definition at line 314 of file ezvoucher.php.

## ◆ keyNumber()

eZVoucher::keyNumber | ( |  | ) |

Returns the keynumber

Definition at line 269 of file ezvoucher.php.

References $KeyNumber.

## ◆ price()

& eZVoucher::price | ( |  | ) |

Returns the price of the voucher.

Definition at line 365 of file ezvoucher.php.

References $Price.

## ◆ product()

& eZVoucher::product | ( |  | $asObject = `true` | ) |

Returns the product

Definition at line 290 of file ezvoucher.php.

References $ProductID, and $ret.

Referenced by correctPrice().

## ◆ setAvailable()

eZVoucher::setAvailable | ( |  | $value | ) |

Sets if the voucher is available or not.

Definition at line 303 of file ezvoucher.php.

## ◆ setPrice()

eZVoucher::setPrice | ( |  | $value | ) |

Sets the voucher price.

Definition at line 325 of file ezvoucher.php.

## ◆ setProduct()

eZVoucher::setProduct | ( | & | $product | ) |

Sets the product of this object.

Definition at line 354 of file ezvoucher.php.

References $product, and $user.

## ◆ setTotalValue()

eZVoucher::setTotalValue | ( |  | $value | ) |

Sets the total voucher price.

Definition at line 334 of file ezvoucher.php.

## ◆ setUser()

eZVoucher::setUser | ( | & | $user | ) |

Sets the user of this object.

Definition at line 343 of file ezvoucher.php.

References $user.

## ◆ store()

eZVoucher::store | ( |  | ) |

Stores a eZVoucher object to the database.

Definition at line 78 of file ezvoucher.php.

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

## ◆ totalValue()

& eZVoucher::totalValue | ( |  | ) |

Returns the total value price of the voucher.

Definition at line 373 of file ezvoucher.php.

References $TotalValue.

## ◆ usedList()

eZVoucher::usedList | ( |  | $id = `false` | ) |

Returns all the used vouchers.

Definition at line 494 of file ezvoucher.php.

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

## ◆ user()

& eZVoucher::user | ( |  | $asObject = `true` | ) |

Returns the user

Definition at line 277 of file ezvoucher.php.

References $ret, and $UserID.

## Member Data Documentation

## ◆ $Available

eZVoucher::$Available

Definition at line 515 of file ezvoucher.php.

## ◆ $Created

eZVoucher::$Created

Definition at line 514 of file ezvoucher.php.

## ◆ $ID

eZVoucher::$ID

Definition at line 512 of file ezvoucher.php.

Referenced by __construct(), delete(), id(), and usedList().

## ◆ $KeyNumber

eZVoucher::$KeyNumber

Definition at line 513 of file ezvoucher.php.

Referenced by keyNumber().

## ◆ $Price

eZVoucher::$Price

Definition at line 516 of file ezvoucher.php.

Referenced by correctPrice(), and price().

## ◆ $ProductID

eZVoucher::$ProductID

Definition at line 518 of file ezvoucher.php.

Referenced by product().

## ◆ $TotalValue

eZVoucher::$TotalValue

Definition at line 519 of file ezvoucher.php.

Referenced by totalValue().

## ◆ $UserID

eZVoucher::$UserID

Definition at line 517 of file ezvoucher.php.

Referenced by user().

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

- ezvoucher.php

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