source: src/mvc/event.h @ 680a4da

qt5
Last change on this file since 680a4da was 680a4da, checked in by pavelpa <pavelpa@…>, 12 years ago

work on favourite

  • created 'favourite' column in EVENT table
  • modified 'ormrecord' for setting record's elements
  • favourities view not implemented
  • Property mode set to 100644
File size: 1.6 KB
Line 
1#ifndef EVENT_H
2#define EVENT_H
3
4#include <QDateTime>
5#include <QVector>
6#include <QStringList>
7
8#include <ormrecord.h>
9
10/**
11  NoSuchEventException is thrown when required event does not exist.
12*/
13class NoSuchEventException
14{
15};
16
17class Event : public OrmRecord<Event>
18{
19public:
20    static QSqlRecord const sColumns;
21    static QString const sTableName;
22
23public:
24    static Event getById(int id, int conferenceId);
25    static QList<Event> getByDate(const QDate& date, int conferenceId);
26
27public:
28    int id() const { return value("id").toInt(); }
29    int conferenceId() const { return value("xid_conference").toInt(); }
30    QDateTime start() const { return value("start").toDateTime(); }
31    int duration() const { return value("duration").toInt(); }
32    int activityId() const { return value("xid_activity").toInt(); }
33    QString type() const { return value("type").toString(); }
34    QString language() const { return value("language").toString(); }
35    bool isFavourite() const { return value("favourite").toBool(); }
36
37    void setId(int id) { setValue("id", id); }
38    void setConferenceId(int conferenceId) { setValue("xid_conference", conferenceId); }
39    void setStart(const QDateTime& start) { setValue("start", start); }
40    void setDuration(int duration) { setValue("duration", duration); }
41    void setActivityId(int activityId) { setValue("xid_activity", activityId); }
42    void setType(const QString& type) { setValue("type", type); }
43    void setLanguage(const QString& language) { setValue("language", language); }
44    void setFavourite(bool favourite) { setValue("favourite", favourite); }
45
46friend class EventTest;
47};
48
49#endif // EVENT_H
50
Note: See TracBrowser for help on using the repository browser.