summaryrefslogtreecommitdiff
path: root/lib/api/kolab_api_service_type.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/kolab_api_service_type.php')
-rw-r--r--lib/api/kolab_api_service_type.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/api/kolab_api_service_type.php b/lib/api/kolab_api_service_type.php
index 868018b..09bbc8c 100644
--- a/lib/api/kolab_api_service_type.php
+++ b/lib/api/kolab_api_service_type.php
@@ -104,16 +104,16 @@ class kolab_api_service_type extends kolab_api_service
$query = array_map(array($this->db, 'quote'), $query);
$columns = array_map(array($this->db, 'quote_identifier'), array_keys($query));
- $this->db->query("INSERT INTO {$type}_types"
+ $this->db->query("INSERT INTO `{$type}_types`"
. " (" . implode(', ', $columns) . ") VALUES (" . implode(', ', $query) . ")");
- if (!($id = $this->db->insert_id())) {
+ if (!($id = $this->db->insert_id($type . '_types'))) {
return false;
}
// there can be only one default
if ($postdata['is_default']) {
- $this->db->query("UPDATE {$type}_types SET is_default = 0 WHERE id <> " . intval($id));
+ $this->db->query("UPDATE `{$type}_types` SET `is_default` = 0 WHERE `id` <> " . intval($id));
}
// update cache
@@ -150,7 +150,7 @@ class kolab_api_service_type extends kolab_api_service
return false;
}
- $this->db->query("DELETE FROM {$object_name}_types WHERE id = " . intval($object_id));
+ $this->db->query("DELETE FROM `{$object_name}_types` WHERE `id` = " . intval($object_id));
return (bool) $this->db->affected_rows();
}
@@ -199,8 +199,8 @@ class kolab_api_service_type extends kolab_api_service
$query[$idx] = $this->db->quote_identifier($idx) . " = " . $this->db->quote($value);
}
- $result = $this->db->query("UPDATE {$type}_types SET "
- . implode(', ', $query) . " WHERE id = " . intval($postdata['id']));
+ $result = $this->db->query("UPDATE `{$type}_types` SET "
+ . implode(', ', $query) . " WHERE `id` = " . intval($postdata['id']));
if (!$result) {
return false;
@@ -208,7 +208,7 @@ class kolab_api_service_type extends kolab_api_service
// there can be only one default
if ($postdata['is_default']) {
- $this->db->query("UPDATE {$type}_types SET is_default = 0 WHERE id <> " . intval($postdata['id']));
+ $this->db->query("UPDATE `{$type}_types` SET `is_default` = 0 WHERE `id` <> " . intval($postdata['id']));
}
// update cache