2 * Copyright (C) 2010 Ixonos Plc.
3 * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl
5 * This file is part of ConfClerk.
7 * ConfClerk is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation, either version 2 of the License, or (at your option)
12 * ConfClerk is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * ConfClerk. If not, see <http://www.gnu.org/licenses/>.
25 #include <QStringList>
27 #include "ormrecord.h"
29 class Conference : public OrmRecord<Conference>
32 static QSqlRecord const sColumns;
33 static QString const sTableName;
36 static Conference getById(int id);
37 static QList<Conference> getAll();
38 static int activeConference(); ///< returns -1 if no conference is active
41 int id() const { return value("id").toInt(); }
42 QString title() const { return value("title").toString(); }
43 QString subtitle() const { return value("subtitle").toString(); }
44 QString venue() const { return value("venue").toString(); }
45 QString city() const { return value("city").toString(); }
46 QDate start() const { return value("start").toDate(); }
47 QDate end() const { return value("end").toDate(); }
48 int dayChange() const { return value("day_change").toInt(); } // in seconds from 00:00
49 int timeslotDuration() const { return value("timeslot_duration").toInt(); } // in seconds
50 bool isActive() const { return value("active").toBool(); }
51 QString url() const { return stringFromNullable(value("url")); }
53 void setUrl(const QString& url)
55 setValue("url", url.isNull() ? QVariant() : url);
60 static QString stringFromNullable(const QVariant& v)
70 #endif /* CONFERENCE_H */