24 function &
getSetting($tombstoneId, $name, $locale =
null) {
25 $sql =
'SELECT setting_value, setting_type FROM data_object_tombstone_settings WHERE tombstone_id = ? AND setting_name = ?';
26 $params = array((
int) $tombstoneId, $name);
27 if ($locale !==
null) {
28 $sql .=
' AND l.locale = ?';
31 $result = $this->
retrieve($sql, $params);
34 while (!$result->EOF) {
35 $row = $result->getRowAssoc(
false);
36 $value = $this->
convertFromDB($row[
'setting_value'], $row[
'setting_type']);
37 if (!array_key_exists(
'locale', $row) || $row[
'locale'] ==
'') $setting[$name] = $value;
38 else $setting[$name][$row[
'locale']] = $value;
54 function updateSetting($tombstoneId, $name, $value, $type =
null, $isLocalized =
false) {
57 $keyFields = array(
'tombstone_id',
'setting_name',
'locale');
61 $this->
replace(
'data_object_tombstone_settings',
63 'tombstone_id' => $tombstoneId,
64 'setting_name' => $name,
65 'setting_value' => $value,
66 'setting_type' => $type,
73 if (is_array($value))
foreach ($value as $locale => $localeValue) {
74 $this->
update(
'DELETE FROM data_object_tombstone_settings WHERE tombstone_id = ? AND setting_name = ? AND locale = ?', array((
int) $tombstoneId, $name, $locale));
75 if (empty($localeValue))
continue;
77 $returner = $this->
update(
'INSERT INTO data_object_tombstone_settings
78 (tombstone_id, setting_name, setting_value, setting_type, locale)
79 VALUES (?, ?, ?, ?, ?)',
81 (
int) $tombstoneId, $name, $this->
convertToDB($localeValue, $type), $type, $locale
96 $params = array((
int) $tombstoneId, $name);
97 $sql =
'DELETE FROM data_object_tombstone_settings WHERE tombstone_id = ? AND setting_name = ?';
98 if ($locale !==
null) {
100 $sql .=
' AND locale = ?';
102 return $this->
update($sql, $params);
111 'DELETE FROM data_object_tombstone_settings WHERE tombstone_id = ?', (
int) $tombstoneId