summaryrefslogtreecommitdiff
path: root/includes/model/EventConfig_model.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-08-20 20:58:51 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-08-20 21:07:57 +0200
commitd6c8f1a61475fefa9594141aaf12a28d220bdaf8 (patch)
tree905051fdb1307f947c3a3a7be240609f8bc00e59 /includes/model/EventConfig_model.php
parentbf6efe532c8f2de84e95b090911280a9b1b61ce8 (diff)
parent2f41b9e4418def9b69cf237312bc592364585025 (diff)
Merge branch 'master' to 'rebuild-database'
Diffstat (limited to 'includes/model/EventConfig_model.php')
-rw-r--r--includes/model/EventConfig_model.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/includes/model/EventConfig_model.php b/includes/model/EventConfig_model.php
index 646d19c5..766a5849 100644
--- a/includes/model/EventConfig_model.php
+++ b/includes/model/EventConfig_model.php
@@ -9,7 +9,9 @@ use Engelsystem\Database\DB;
*/
function EventConfig()
{
- return DB::selectOne('SELECT * FROM `EventConfig` LIMIT 1');
+ $config = DB::selectOne('SELECT * FROM `EventConfig` LIMIT 1');
+
+ return empty($config) ? null : $config;
}
/**
@@ -21,7 +23,7 @@ function EventConfig()
* @param int $event_end_date
* @param int $teardown_end_date
* @param string $event_welcome_msg
- * @return int Rows updated
+ * @return bool
*/
function EventConfig_update(
$event_name,
@@ -31,7 +33,8 @@ function EventConfig_update(
$teardown_end_date,
$event_welcome_msg
) {
- if (EventConfig() == null) {
+ $eventConfig = EventConfig();
+ if (empty($eventConfig)) {
return DB::insert('
INSERT INTO `EventConfig` (
`event_name`,
@@ -54,7 +57,7 @@ function EventConfig_update(
);
}
- return DB::update('
+ return (bool)DB::update('
UPDATE `EventConfig` SET
`event_name` = ?,
`buildup_start_date` = ?,