FactDev  0.1
Models::Contributory Class Reference

The Unit enum Unity of work : hour or day. More...

#include <contributory.h>

Inheritance diagram for Models::Contributory:
Models::IModel Models::Calculable

Public Member Functions

 Contributory ()
 Contributory::Contributory Contruct a Contributory.
 
 Contributory (int id)
 Contributory::Contributory Contruct a Contributory and get data in database. More...
 
 ~Contributory ()
 Destroy an contributory object.
 
void commit ()
 Contributory::commit Update or insert a contributory to the database.
 
void hydrat (int id)
 Contributory::hydrat Get data about the Contributory which is specified by the identify id More...
 
void remove ()
 Contributory::remove Remove the current Contributory.
 
double getPrice (const bool paied=false)
 getPrice Return the price of a contributory More...
 
double getSumQuantity ()
 ContributoriesList::getSumQuantity Return the sum of quantity (number of hours) of the Contributories. More...
 
QVariantHash getDataMap ()
 getDataMap Get all data of model with a HashMap key/value More...
 
ProjectgetProject () const
 Contributory::getProject Return the project linked to this Contributory. More...
 
void setProject (Project *id)
 Contributory::setProject Modify the identify id of the Project linked to this Contributory. More...
 
double getQuantity () const
 getNbHours Number of work hour of a contributory More...
 
void setQuantity (double value)
 setNbHours Change nbHours More...
 
QString getDescription () const
 getDescription Description of a contributory More...
 
void setDescription (const QString &getDescription)
 setDescription Change the contributory description More...
 
bool operator== (const Contributory &c)
 operator == define the operator "==" to compare two Contributory More...
 
bool operator!= (const Contributory &c)
 operator != define the operator "!=" to compare two Contributory More...
 
QString getLongDescription () const
 getLongDescription A contributory has a long description : display in tex appendix More...
 
void setLongDescription (const QString &getLongDescription)
 setLongDescription Change the long description More...
 
Unit getUnit () const
 getUnit Return the unit (hour or day) of contributory More...
 
void setUnit (const Unit &value)
 setUnit Change the unit More...
 
double getHourlyRate () const
 getHourlyRate Hourly rate for this contributory More...
 
void setHourlyRate (double value)
 setHourlyRate Change the hourly rate for this contributory More...
 
- Public Member Functions inherited from Models::IModel
virtual ~IModel ()
 ~IModel Remove an instance of IModel
 
int getId () const
 IModel::getId Return the identify of the element of the database. More...
 
void setId (int id)
 IModel::setId Replace the current identify by id More...
 
bool isToRemoved () const
 toRemoved return if object must be removed. More...
 
void setToRemoved (bool toRemoved)
 setToRemoved Change the flag for removed object More...
 

Additional Inherited Members

- Protected Attributes inherited from Models::IModel
int _id
 Element identify.
 
bool _toRemoved
 Flag to know if the object must be removed.
 

Detailed Description

The Unit enum Unity of work : hour or day.

Author
The Contributory class

Constructor & Destructor Documentation

Models::Contributory::Contributory ( int  id)

Contributory::Contributory Contruct a Contributory and get data in database.

Parameters
idContributory's id

Member Function Documentation

QVariantHash Models::Contributory::getDataMap ( )
virtual

getDataMap Get all data of model with a HashMap key/value

Returns
Model's data

Implements Models::IModel.

QString Models::Contributory::getDescription ( ) const

getDescription Description of a contributory

Returns
The description
double Models::Contributory::getHourlyRate ( ) const

getHourlyRate Hourly rate for this contributory

Returns
The hourly rate
QString Models::Contributory::getLongDescription ( ) const

getLongDescription A contributory has a long description : display in tex appendix

Returns
The long description
double Models::Contributory::getPrice ( const bool  paied = false)
virtual

getPrice Return the price of a contributory

Returns
The price

Implements Models::Calculable.

Project * Models::Contributory::getProject ( ) const

Contributory::getProject Return the project linked to this Contributory.

Returns
Project linked to this Contributory
double Models::Contributory::getQuantity ( ) const

getNbHours Number of work hour of a contributory

Returns
Then number of hours
double Models::Contributory::getSumQuantity ( )
virtual

ContributoriesList::getSumQuantity Return the sum of quantity (number of hours) of the Contributories.

Returns
sum of quantity in hours

Implements Models::Calculable.

Unit Models::Contributory::getUnit ( ) const

getUnit Return the unit (hour or day) of contributory

Returns
The unit
void Models::Contributory::hydrat ( int  id)
virtual

Contributory::hydrat Get data about the Contributory which is specified by the identify id

Parameters
idContributory identify

Implements Models::IModel.

bool Models::Contributory::operator!= ( const Contributory c)

operator != define the operator "!=" to compare two Contributory

Parameters
cthe Contributory to compare with the current Contributory
Returns
true if the Contributory are different else false
bool Models::Contributory::operator== ( const Contributory c)

operator == define the operator "==" to compare two Contributory

Parameters
cthe Contributory to compare with the current Contributory
Returns
true if the Contributory are equals else false
void Models::Contributory::setDescription ( const QString &  getDescription)

setDescription Change the contributory description

Parameters
getDescriptionThe new description
void Models::Contributory::setHourlyRate ( double  value)

setHourlyRate Change the hourly rate for this contributory

Parameters
valueThe hourly rate
void Models::Contributory::setLongDescription ( const QString &  getLongDescription)

setLongDescription Change the long description

Parameters
getLongDescriptionThe new description
void Models::Contributory::setProject ( Project id)

Contributory::setProject Modify the identify id of the Project linked to this Contributory.

Parameters
idProject Identify
void Models::Contributory::setQuantity ( double  value)

setNbHours Change nbHours

Parameters
valueThe new value of nbHours
void Models::Contributory::setUnit ( const Unit value)

setUnit Change the unit

Parameters
valueThe new unit

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