1 | #ifndef CONFERENCE_H |
---|
2 | #define CONFERENCE_H |
---|
3 | |
---|
4 | #include <QDateTime> |
---|
5 | #include <QVector> |
---|
6 | #include <QStringList> |
---|
7 | |
---|
8 | #include <ormrecord.h> |
---|
9 | |
---|
10 | class Conference : public OrmRecord<Conference> |
---|
11 | { |
---|
12 | public: |
---|
13 | static QSqlRecord const sColumns; |
---|
14 | static QString const sTableName; |
---|
15 | |
---|
16 | public: |
---|
17 | static Conference getById(int id); |
---|
18 | static QList<Conference> getAll(); |
---|
19 | |
---|
20 | public: |
---|
21 | int id() const { return value("id").toInt(); } |
---|
22 | QString title() const { return value("title").toString(); } |
---|
23 | QString subtitle() const { return value("subtitle").toString(); } |
---|
24 | QString venue() const { return value("venue").toString(); } |
---|
25 | QString city() const { return value("city").toString(); } |
---|
26 | QDate start() const { return value("start").toDate(); } |
---|
27 | QDate end() const { return value("end").toDate(); } |
---|
28 | int days() const { return value("days").toInt(); } |
---|
29 | int dayChange() const { return value("day_change").toInt(); } // in seconds from 00:00 |
---|
30 | int timeslotDuration() const { return value("timeslot_duration").toInt(); } // in seconds |
---|
31 | |
---|
32 | void setId(int id) { setValue("id", id); } |
---|
33 | void setTitle(const QString& title) { setValue("title", title); } |
---|
34 | void setSubtitle(const QString& subtitle) { setValue("subtitle", subtitle); } |
---|
35 | void setVenue(const QString& venue) { setValue("venue", venue); } |
---|
36 | void setCity(const QString& city) { setValue("city", city); } |
---|
37 | //void setStart(const QDate& start) { setValue("start", QDateTime(start)); } |
---|
38 | void setStart(const QDate& start) { setValue("start", start); } |
---|
39 | //void setEnd(const QDate& end) { setValue("end", QDateTime(end)); } |
---|
40 | void setEnd(const QDate& end) { setValue("end", end); } |
---|
41 | void setDays(int days) { setValue("days", days); } |
---|
42 | void setDayChange(int dayChange) { setValue("day_change", dayChange); } |
---|
43 | void setTimeslotDuration(int timeslotDuration) { setValue("timeslot_duration", timeslotDuration); } |
---|
44 | }; |
---|
45 | |
---|
46 | #endif /* CONFERENCE_H */ |
---|
47 | |
---|