| @@ 134-144 (lines=11) @@ | ||
| 131 | * @param string $locale |
|
| 132 | * @return object |
|
| 133 | */ |
|
| 134 | public function setTemplateVariables($template_id, $patternVariables, $locale) { |
|
| 135 | if ($this->db->where('id', $template_id)->where('locale', $locale)->get('mod_email_paterns_i18n')->num_rows()) { |
|
| 136 | return $this->db |
|
| 137 | ->where('id', $template_id) |
|
| 138 | ->where('locale', $locale) |
|
| 139 | ->update('mod_email_paterns_i18n', ['variables' => serialize($patternVariables)]); |
|
| 140 | } else { |
|
| 141 | return $this->db |
|
| 142 | ->insert('mod_email_paterns_i18n', ['id' => $template_id, 'locale' => $locale, 'variables' => serialize($patternVariables)]); |
|
| 143 | } |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * @param int $id |
|
| @@ 197-213 (lines=17) @@ | ||
| 194 | * @param string $locale |
|
| 195 | * @return bool |
|
| 196 | */ |
|
| 197 | public function setSettings($settings, $locale = 'ru') { |
|
| 198 | ||
| 199 | $data = $this->db->select('locale') |
|
| 200 | ->where('locale', $locale) |
|
| 201 | ->get('mod_seo') |
|
| 202 | ->row_array(); |
|
| 203 | if (empty($data)) { |
|
| 204 | return $this->db->insert('mod_seo', ['locale' => $locale, 'settings' => serialize($settings)]); |
|
| 205 | } |
|
| 206 | ||
| 207 | return $this->db->where('locale', $locale) |
|
| 208 | ->update( |
|
| 209 | 'mod_seo', |
|
| 210 | [ |
|
| 211 | 'settings' => serialize($settings), |
|
| 212 | ] |
|
| 213 | ); |
|
| 214 | } |
|
| 215 | ||
| 216 | /** |
|