|
Open Monograph Press
3.3.0
|
18 import(
'classes.notification.Notification');
29 'SELECT * FROM notification_settings WHERE notification_id = ?',
34 while (!$result->EOF) {
35 $row = $result->GetRowAssoc(
false);
36 $name = $row[
'setting_name'];
37 $value = $this->
convertFromDB($row[
'setting_value'], $row[
'setting_type']);
38 $locale = $row[
'locale'];
40 if ($locale ==
'') $params[$name] = $value;
41 else $params[$name][$locale] = $value;
59 $keyFields = array(
'setting_name',
'locale',
'notification_id');
62 $this->
replace(
'notification_settings',
64 'notification_id' => (
int) $notificationId,
65 'setting_name' => $name,
66 'setting_value' => $value,
67 'setting_type' => $type,
73 if (is_array($value))
foreach ($value as $locale => $localeValue) {
74 $this->
update(
'DELETE FROM notification_settings WHERE notification_id = ? AND setting_name = ? AND locale = ?', array($notificationId, $name, $locale));
75 if (empty($localeValue))
continue;
77 $this->
update(
'INSERT INTO notification_settings
78 (notification_id, setting_name, setting_value, setting_type, locale)
79 VALUES (?, ?, ?, ?, ?)',
81 (
int) $notificationId,
96 return $this->
update(
'DELETE FROM notification_settings WHERE notification_id = ?', (
int) $notificationId);
updateNotificationSetting($notificationId, $name, $value, $isLocalized=false, $type=null)
deleteSettingsByNotificationId($notificationId)
convertToDB($value, &$type)
getNotificationSettings($notificationId)
& retrieve($sql, $params=false, $callHooks=true)
convertFromDB($value, $type)
Operations for retrieving and modifying Notification metadata.
update($sql, $params=false, $callHooks=true, $dieOnError=true)
replace($table, $arrFields, $keyCols)
Operations for retrieving and modifying objects from a database.