MagicSmoke  $VERSION$
MOTicketAbstract Class Reference

This class represents the data of a ticket as stored in the database. More...

#include <srcMOTicketAbstract.h>

Inheritance diagram for MOTicketAbstract:
MOTicket MOTicketAudit

Public Types

enum  TicketState {
  Reserved =785, Ordered =786, Used =771, Cancelled =4,
  Refund =4, MaskBlock =256, MaskPay =512, MaskUsable =768,
  MaskReturnable =16, MaskChangeable =16
}
 

Public Member Functions

 MOTicketAbstract ()
 default constructor: constructs an invalid instance of MOTicketAbstract More...
 
 MOTicketAbstract (const MOTicketAbstract &)
 copy constructor: creates a (deep) copy of the object More...
 
 MOTicketAbstract (const QDomElement &)
 special constructor: create from the XML representation, deserializing the object More...
 
virtual ~MOTicketAbstract ()
 destructor: deletes this copy of the object More...
 
virtual Nullable< qint64 > eventid () const
 
MOTicketAbstractoperator= (const MOTicketAbstract &)
 copy assignment: creates a (deep) copy of the object More...
 
virtual Nullable< qint64 > orderid () const
 
virtual Nullable< qint64 > price () const
 
virtual Nullable< MOPriceCategorypricecategory () const
 
virtual Nullable< qint64 > pricecategoryid () const
 
 Q_ENUMS (TicketState)
 
virtual Nullable< QString > seat () const
 
virtual void seteventid (Nullable< qint64 > s)
 
virtual void setorderid (Nullable< qint64 > s)
 
virtual void setprice (Nullable< qint64 > s)
 
virtual void setpricecategory (Nullable< MOPriceCategory > s)
 
virtual void setpricecategoryid (Nullable< qint64 > s)
 
virtual void setseat (Nullable< QString > s)
 
virtual void setstatus (Nullable< TicketState > s)
 
virtual void settags (Nullable< QString > s)
 
virtual void setticketid (Nullable< QString > s)
 uniquely identifies the ticket, this ID is automatically generated when the ticket is created by the server More...
 
virtual Nullable< TicketStatestatus () const
 
virtual Nullable< QString > tags () const
 
virtual Nullable< QString > ticketid () const
 uniquely identifies the ticket, this ID is automatically generated when the ticket is created by the server More...
 
QString toString ()
 Serializes the object to XML and returns the string representation of that XML. More...
 
QDomElement toXml (QDomDocument &doc, QString name="Ticket")
 Transforms the object into its XML representation, the element node returned is not appended to the document - you have to do that yourself. More...
 
void toXml (QDomDocument &, QDomElement &)
 Serializes the object into the given element. More...
 

Static Public Member Functions

static MOTicketAbstract fromString (const QString &)
 create MOTicketAbstract from XML formatted string (inverse of toString) More...
 
static MOTicketAbstract fromXml (const QDomElement &)
 create MOTicketAbstract from XML (inverse of toXml) More...
 
static TicketState locstr2TicketState (QString, bool *ok=0)
 Converts a localized string into the corresponding enum TicketState value. More...
 
static TicketState str2TicketState (QString, bool *ok=0)
 Converts string into the corresponding enum TicketState value. More...
 
static QString TicketState2locstr (TicketState)
 Converts enum TicketState value into the corresponding localized string. More...
 
static QString TicketState2str (TicketState)
 Converts enum TicketState value into the corresponding string. More...
 

Protected Attributes

Nullable< qint64 > mp_eventid
 
Nullable< qint64 > mp_orderid
 
Nullable< qint64 > mp_price
 
Nullable< MOPriceCategorymp_pricecategory
 
Nullable< qint64 > mp_pricecategoryid
 
Nullable< QString > mp_seat
 
Nullable< TicketStatemp_status
 
Nullable< QString > mp_tags
 
Nullable< QString > mp_ticketid
 

Properties

Nullable< qint64 > eventid
 
Nullable< qint64 > orderid
 
Nullable< qint64 > price
 
Nullable< MOPriceCategorypricecategory
 
Nullable< qint64 > pricecategoryid
 
Nullable< QString > seat
 
Nullable< TicketStatestatus
 
Nullable< QString > tags
 
Nullable< QString > ticketid
 uniquely identifies the ticket, this ID is automatically generated when the ticket is created by the server More...
 

Detailed Description

This class represents the data of a ticket as stored in the database.

Member Enumeration Documentation

Enumerator
Reserved 

The ticket is reserved for a customer, it blocks the seat, but is not to be paid yet.

Ordered 

The ticket is ordered/sold and possibly paid for (payment is stored in its order).

Used 

The ticket has been used.

Cancelled 

The ticket has been given back for some reason and needs to be re-imbursed (if paid already).

Refund 

Alias for Cancelled.

MaskBlock 

Masking value: if this bit is set the ticket blocks a seat.

MaskPay 

Masking value: if this bit is set the ticket must be paid by the customer.

MaskUsable 

Masking value: combines Block+Pay - the ticket can be used to watch a show or is already being used.

MaskReturnable 

Masking value: if this bit is set the ticket can still be cancelled.

MaskChangeable 

Masking value: if this bit is set the ticket can still be changed (price, event, etc.). Currently an alias for MaskReturnable.

Constructor & Destructor Documentation

MOTicketAbstract::MOTicketAbstract ( )
inline

default constructor: constructs an invalid instance of MOTicketAbstract

Referenced by fromString(), and fromXml().

MOTicketAbstract::MOTicketAbstract ( const MOTicketAbstract o)

copy constructor: creates a (deep) copy of the object

References mp_eventid, mp_orderid, mp_price, mp_pricecategory, mp_pricecategoryid, mp_seat, mp_status, mp_tags, and mp_ticketid.

MOTicketAbstract::MOTicketAbstract ( const QDomElement &  root)
explicit

special constructor: create from the XML representation, deserializing the object

References seteventid(), setorderid(), setprice(), setpricecategory(), setpricecategoryid(), setseat(), setstatus(), settags(), setticketid(), and str2TicketState().

virtual MOTicketAbstract::~MOTicketAbstract ( )
inlinevirtual

destructor: deletes this copy of the object

Member Function Documentation

virtual Nullable<qint64> MOTicketAbstract::eventid ( ) const
inlinevirtual

Referenced by MOTicket::event().

MOTicketAbstract MOTicketAbstract::fromString ( const QString &  txt)
static

create MOTicketAbstract from XML formatted string (inverse of toString)

References MOTicketAbstract().

MOTicketAbstract MOTicketAbstract::fromXml ( const QDomElement &  root)
static

create MOTicketAbstract from XML (inverse of toXml)

References MOTicketAbstract().

MOTicketAbstract::TicketState MOTicketAbstract::locstr2TicketState ( QString  s,
bool *  ok = 0 
)
static

Converts a localized string into the corresponding enum TicketState value.

References Cancelled, MaskBlock, MaskChangeable, MaskPay, MaskReturnable, MaskUsable, Ordered, Refund, Reserved, and Used.

MOTicketAbstract & MOTicketAbstract::operator= ( const MOTicketAbstract o)

copy assignment: creates a (deep) copy of the object

References mp_eventid, mp_orderid, mp_price, mp_pricecategory, mp_pricecategoryid, mp_seat, mp_status, mp_tags, and mp_ticketid.

Referenced by MOTicketAudit::operator=().

virtual Nullable<qint64> MOTicketAbstract::orderid ( ) const
inlinevirtual
virtual Nullable<qint64> MOTicketAbstract::price ( ) const
inlinevirtual
virtual Nullable<MOPriceCategory> MOTicketAbstract::pricecategory ( ) const
inlinevirtual
virtual Nullable<qint64> MOTicketAbstract::pricecategoryid ( ) const
inlinevirtual
MOTicketAbstract::Q_ENUMS ( TicketState  )
virtual Nullable<QString> MOTicketAbstract::seat ( ) const
inlinevirtual
virtual void MOTicketAbstract::seteventid ( Nullable< qint64 >  s)
inlinevirtual
virtual void MOTicketAbstract::setorderid ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOTicketAbstract().

virtual void MOTicketAbstract::setprice ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOTicketAbstract().

virtual void MOTicketAbstract::setpricecategory ( Nullable< MOPriceCategory s)
inlinevirtual

Referenced by MOTicketAbstract().

virtual void MOTicketAbstract::setpricecategoryid ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOTicketAbstract().

virtual void MOTicketAbstract::setseat ( Nullable< QString >  s)
inlinevirtual

Referenced by MOTicketAbstract().

virtual void MOTicketAbstract::setstatus ( Nullable< TicketState s)
inlinevirtual

Referenced by MOTicketAbstract().

virtual void MOTicketAbstract::settags ( Nullable< QString >  s)
inlinevirtual

Referenced by MOTicketAbstract().

virtual void MOTicketAbstract::setticketid ( Nullable< QString >  s)
inlinevirtual

uniquely identifies the ticket, this ID is automatically generated when the ticket is created by the server

Referenced by MOTicketAbstract().

virtual Nullable<TicketState> MOTicketAbstract::status ( ) const
inlinevirtual
MOTicketAbstract::TicketState MOTicketAbstract::str2TicketState ( QString  s,
bool *  ok = 0 
)
static

Converts string into the corresponding enum TicketState value.

References Cancelled, MaskBlock, MaskChangeable, MaskPay, MaskReturnable, MaskUsable, Ordered, Refund, Reserved, and Used.

Referenced by MOTicketAbstract().

virtual Nullable<QString> MOTicketAbstract::tags ( ) const
inlinevirtual
virtual Nullable<QString> MOTicketAbstract::ticketid ( ) const
inlinevirtual

uniquely identifies the ticket, this ID is automatically generated when the ticket is created by the server

Referenced by MOTicket::event().

QString MOTicketAbstract::TicketState2locstr ( TicketState  e)
static

Converts enum TicketState value into the corresponding localized string.

References Cancelled, MaskBlock, MaskChangeable, MaskPay, MaskReturnable, MaskUsable, Ordered, Refund, Reserved, and Used.

Referenced by MOTicket::statusString().

QString MOTicketAbstract::TicketState2str ( TicketState  e)
static

Converts enum TicketState value into the corresponding string.

References Cancelled, MaskBlock, MaskChangeable, MaskPay, MaskReturnable, MaskUsable, Ordered, Refund, Reserved, and Used.

QString MOTicketAbstract::toString ( )

Serializes the object to XML and returns the string representation of that XML.

References toXml().

QDomElement MOTicketAbstract::toXml ( QDomDocument &  doc,
QString  name = "Ticket" 
)

Transforms the object into its XML representation, the element node returned is not appended to the document - you have to do that yourself.

Parameters
docthe DOM document node for which to generate the element
namethe name to give the generated element, per default "MOTicketAbstract" is used

Referenced by toString(), and MOTicketAudit::toXml().

void MOTicketAbstract::toXml ( QDomDocument &  doc,
QDomElement &  r 
)

Serializes the object into the given element.

References mp_eventid, mp_orderid, mp_price, mp_pricecategory, mp_pricecategoryid, mp_seat, mp_status, mp_tags, and mp_ticketid.

Member Data Documentation

Nullable<qint64> MOTicketAbstract::mp_eventid
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Nullable<qint64> MOTicketAbstract::mp_orderid
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Nullable<qint64> MOTicketAbstract::mp_price
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Nullable<MOPriceCategory> MOTicketAbstract::mp_pricecategory
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Nullable<qint64> MOTicketAbstract::mp_pricecategoryid
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Nullable<QString> MOTicketAbstract::mp_seat
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Nullable<TicketState> MOTicketAbstract::mp_status
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Nullable<QString> MOTicketAbstract::mp_tags
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Nullable<QString> MOTicketAbstract::mp_ticketid
protected

Referenced by MOTicketAbstract(), operator=(), and toXml().

Property Documentation

Nullable<qint64> MOTicketAbstract::eventid
readwrite

Referenced by compare().

Nullable<qint64> MOTicketAbstract::orderid
readwrite
Nullable<qint64> MOTicketAbstract::price
readwrite

Referenced by compare().

Nullable<MOPriceCategory> MOTicketAbstract::pricecategory
readwrite
Nullable<qint64> MOTicketAbstract::pricecategoryid
readwrite
Nullable<QString> MOTicketAbstract::seat
readwrite
Nullable<TicketState> MOTicketAbstract::status
readwrite
Nullable<QString> MOTicketAbstract::tags
readwrite
Nullable<QString> MOTicketAbstract::ticketid
readwrite

uniquely identifies the ticket, this ID is automatically generated when the ticket is created by the server

Referenced by MOAItem::itemID().


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