source: src/model/event.h @ 489f262

qt5
Last change on this file since 489f262 was 489f262, checked in by komarma <komarma@…>, 13 years ago

Fixing datetime conversion

  • Property mode set to 100644
File size: 1.4 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/**
12  NoSuchEventException is thrown when required event does not exist.
13*/
14class NoSuchEventException
15{
16};
17
18class Event : public OrmRecord<Event>
19{
20public:
21    static QSqlRecord const sColumns;
22    static QString const sTableName;
23
24public:
25    static Event getById(int id, 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
36    void setId(int id) { setValue("id", id); }
37    void setConferenceId(int conferenceId) { setValue("xid_conference", conferenceId); }
38    void setStart(const QDateTime& start) { setValue("start", start); }
39    void setDuration(int duration) { setValue("duration", duration); }
40    void setActivityId(int activityId) { setValue("xid_activity", activityId); }
41    void setType(const QString& type) { setValue("type", type); }
42    void setLanguage(const QString& language) { setValue("language", language); }
43
44friend class EventTest;
45};
46
47
48
49#endif // EVENT_H
Note: See TracBrowser for help on using the repository browser.