Category Class Reference

#include <Category.h>

Inheritance diagram for Category:
Inheritance graph
[legend]
Collaboration diagram for Category:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Category ()
string primaryKey ()
 Returns the primary for entity "categories" (KEY_CAT_CID).
string getName ()

Static Public Member Functions

static CategorycategoryByID (int aCid)
 Fetch a category by specifing its ID.
static Categoryfactory (string aValue)
 Create a new category to be stored into the database; the method store need to be called to make changes persistent.
static vector< Category * > & catalog ()
 Returns the list of available categories.

Friends

ostream & operator<< (ostream &, Category &)

Constructor & Destructor Documentation

Category::Category (  ) 

Referenced by catalog(), categoryByID(), and factory().


Member Function Documentation

vector< Category * > & Category::catalog (  )  [static]
Category * Category::categoryByID ( int  aCid  )  [static]

Fetch a category by specifing its ID.

Parameters:
[in] aCid Category ID to be fetched
Returns:
An instance of category

References Category(), Database::getConnection(), Database::Instance(), KEY_CAT_CID, KEY_CAT_NAME, ManagedObject::setIntForKey(), ManagedObject::setValueForKey(), and SQL_CATEGORY_BYID.

Referenced by Product::getCategory().

Category * Category::factory ( string  aValue  )  [static]

Create a new category to be stored into the database; the method store need to be called to make changes persistent.

Parameters:
aValue The category name
Returns:
An instance of the new category

References Category(), KEY_CAT_CID, KEY_CAT_NAME, ManagedObject::setIntForKey(), and ManagedObject::setValueForKey().

Referenced by UserMenu::addNewCategory().

string Category::getName (  ) 
string Category::primaryKey (  )  [virtual]

Returns the primary for entity "categories" (KEY_CAT_CID).

Returns:
The primary key of the entity

Implements ManagedObject.

References KEY_CAT_CID.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  aStream,
Category c 
) [friend]

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

Generated by  doxygen 1.6.2