aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Atanasov <lucifer@anavaro.com>2014-06-29 11:51:47 +0300
committerStanislav Atanasov <lucifer@anavaro.com>2014-06-29 11:51:47 +0300
commite3b07274ef514906920006104604b7d43284bf9c (patch)
treeb3d4d40e9417ffe2e573fa8ca09db129ab887bb9
parentb70a1cc4af7831909b87bc3628ab2a06e8b16b83 (diff)
downloadforums-e3b07274ef514906920006104604b7d43284bf9c.tar
forums-e3b07274ef514906920006104604b7d43284bf9c.tar.gz
forums-e3b07274ef514906920006104604b7d43284bf9c.tar.bz2
forums-e3b07274ef514906920006104604b7d43284bf9c.tar.xz
forums-e3b07274ef514906920006104604b7d43284bf9c.zip
[ticket/12786] Add create_language_entries
Add function to create entries in PROFILE_FIELDS_LANG_TABLE PHPBB3-12786
-rw-r--r--phpBB/phpbb/db/migration/profilefield_base_migration.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php
index 31244bf957..f96495d2df 100644
--- a/phpBB/phpbb/db/migration/profilefield_base_migration.php
+++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php
@@ -112,6 +112,36 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
}
/**
+ * Create Custom profile fields languguage entries
+ */
+ public function create_language_entries()
+ {
+ $field_id = $this->get_custom_profile_field_id();
+
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_FIELDS_LANG_TABLE);
+
+ $sql = 'SELECT lang_id
+ FROM ' . LANG_TABLE;
+ $result = $this->db->sql_query($sql);
+ while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))
+ {
+ foreach ($this->profilefield_language_data as $language_data)
+ {
+ $insert_buffer->insert(array(
+ 'field_id' => $field_id,
+ 'lang_id' => $lang_id,
+ 'option_id' => $language_data['option_id'],
+ 'field_type' => $language_data['field_type'],
+ 'lang_value' => $language_data['lang_value'],
+ ));
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $insert_buffer->flush();
+ }
+
+ /**
* Get custom profile field id
* @return int custom profile filed id
*/