10 class Conference : public OrmRecord<Conference>
13 static QSqlRecord const sColumns;
14 static QString const sTableName;
17 static Conference getById(int id);
18 static QList<Conference> getAll();
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 // TODO: there is some problem with converting "Time_t" to QDateTime: had to manually add 1 day
28 QDate start() const { return value("start").toDateTime().addDays(1).date(); }
29 QDate end() const { return value("end").toDateTime().addDays(1).date(); }
31 int days() const { return value("days").toInt(); }
32 int dayChange() const { return value("day_change").toInt(); } // in seconds from 00:00
33 int timeslotDuration() const { return value("timeslot_duration").toInt(); } // in seconds
35 void setId(int id) { setValue("id", id); }
36 void setTitle(const QString& title) { setValue("title", title); }
37 void setSubtitle(const QString& subtitle) { setValue("subtitle", subtitle); }
38 void setVenue(const QString& venue) { setValue("venue", venue); }
39 void setCity(const QString& city) { setValue("city", city); }
40 //void setStart(const QDate& start) { setValue("start", QDateTime(start)); }
41 void setStart(const QDate& start) { setValue("start", start); }
42 //void setEnd(const QDate& end) { setValue("end", QDateTime(end)); }
43 void setEnd(const QDate& end) { setValue("end", end); }
44 void setDays(int days) { setValue("days", days); }
45 void setDayChange(int dayChange) { setValue("day_change", dayChange); }
46 void setTimeslotDuration(int timeslotDuration) { setValue("timeslot_duration", timeslotDuration); }
49 #endif /* CONFERENCE_H */