source: src/mvc/event.h @ 92995da

qt5
Last change on this file since 92995da was 92995da, checked in by pavelpa <pavelpa@…>, 13 years ago

just some directory renaming

  • renamed 'model' to 'mvc' (Model-View-Controller), since it contains also 'delegate' and 'view'
  • Property mode set to 100644
File size: 1.5 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    static QList<Event> getByDate(const QDate& date, int conferenceId);
27
28public:
29    int id() const { return value("id").toInt(); }
30    int conferenceId() const { return value("xid_conference").toInt(); }
31    QDateTime start() const { return value("start").toDateTime(); }
32    int duration() const { return value("duration").toInt(); }
33    int activityId() const { return value("xid_activity").toInt(); }
34    QString type() const { return value("type").toString(); }
35    QString language() const { return value("language").toString(); }
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
45friend class EventTest;
46};
47
48
49
50#endif // EVENT_H
Note: See TracBrowser for help on using the repository browser.