summaryrefslogtreecommitdiff
path: root/includes/model/AngelType_model.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-07-28 19:15:52 +0200
committermsquare <msquare@notrademark.de>2017-07-28 19:15:52 +0200
commita0af8d4624be9ca8579817d291036a6727aeb574 (patch)
tree869e7c39a3ec05aa6a4e478b51eb59bbf42746d1 /includes/model/AngelType_model.php
parent5794c4cab8f6ef0529dfc51343b5ec78b134fb2a (diff)
further switching to db exceptions instead of return false
Diffstat (limited to 'includes/model/AngelType_model.php')
-rw-r--r--includes/model/AngelType_model.php22
1 files changed, 2 insertions, 20 deletions
diff --git a/includes/model/AngelType_model.php b/includes/model/AngelType_model.php
index b9238467..f08733d5 100644
--- a/includes/model/AngelType_model.php
+++ b/includes/model/AngelType_model.php
@@ -213,7 +213,7 @@ function AngelType_validate_name($name, $angeltype)
*/
function AngelTypes_with_user($user)
{
- $result = DB::select('
+ return DB::select('
SELECT `AngelTypes`.*,
`UserAngelTypes`.`id` AS `user_angeltype_id`,
`UserAngelTypes`.`confirm_user_id`,
@@ -222,11 +222,6 @@ function AngelTypes_with_user($user)
LEFT JOIN `UserAngelTypes` ON `AngelTypes`.`id`=`UserAngelTypes`.`angeltype_id`
AND `UserAngelTypes`.`user_id` = ?
ORDER BY `name`', [$user['UID']]);
-
- if (DB::getStm()->errorCode() != '00000') {
- engelsystem_error('Unable to load angeltypes.');
- }
- return $result;
}
/**
@@ -236,15 +231,10 @@ function AngelTypes_with_user($user)
*/
function AngelTypes()
{
- $result = DB::select('
+ return DB::select('
SELECT *
FROM `AngelTypes`
ORDER BY `name`');
-
- if (DB::getStm()->errorCode() != '00000') {
- engelsystem_error('Unable to load angeltypes.');
- }
- return $result;
}
/**
@@ -255,10 +245,6 @@ function AngelTypes()
function AngelType_ids()
{
$result = DB::select('SELECT `id` FROM `AngelTypes`');
-
- if (DB::getStm()->errorCode() != '00000') {
- engelsystem_error('Unable to load angeltypes.');
- }
return select_array($result, 'id', 'id');
}
@@ -275,10 +261,6 @@ function AngelType($angeltype_id)
[$angeltype_id]
);
- if (DB::getStm()->errorCode() != '00000') {
- engelsystem_error('Unable to load angeltype.');
- }
-
if (empty($angelType_source)) {
return null;
}