Even this class, as far as AdminUser, derives from User and is associated with entity customer, detailed in ER model. More...
#include <User.h>
Public Member Functions | |
NormalUser () | |
Default constructor. | |
NormalUser (Row &aRow) | |
Class constructor by fetched record. | |
~NormalUser () | |
Default destructor. | |
Order * | placeOrder () throw (string) |
New order creation. | |
Basket * | getBasket () |
Private Attributes | |
Basket | basket |
Even this class, as far as AdminUser, derives from User and is associated with entity customer, detailed in ER model.
A normal user must be intended as a customer who need to browse the product catalog and, possibly, buy one or more products. Whenever a registered user wants to buy a product, he must choose how many pieces of each product should be added to the basket and ask the system to place a new order: the class Basket, as described further on, is the container of products the user chose; it appears clear that the implementation of virtual method getBasket() will return the instance of class Basket owned by the current user.
NormalUser::NormalUser | ( | ) |
NormalUser::NormalUser | ( | Row & | aRow | ) |
Class constructor by fetched record.
Constructs an instance of NormalUser and fill it with data taken from mysqlpp::Row
aRow | Record fetched from the database |
References LOG_CTOR.
NormalUser::~NormalUser | ( | ) |
Default destructor.
References LOG_DTOR.
Order * NormalUser::placeOrder | ( | ) | throw (string) [virtual] |
New order creation.
Call this method when the user has a filled his basket and want to place a new order; if successful, an instance of class Order is returned and the basket is cleared.
Implements User.
References basket, Order::create(), ManagedObject::intForKey(), and KEY_USR_UID.
Basket NormalUser::basket [private] |
Referenced by getBasket(), and placeOrder().