diff options
author | Stanislav Atanasov <lucifer@anavaro.com> | 2014-06-29 11:50:40 +0300 |
---|---|---|
committer | Stanislav Atanasov <lucifer@anavaro.com> | 2014-06-29 11:50:40 +0300 |
commit | b70a1cc4af7831909b87bc3628ab2a06e8b16b83 (patch) | |
tree | 237ddf42d408f54b7d8e993ded019cfda83440bc | |
parent | 564924e876d26d973487a00befb26601b4d9948a (diff) | |
download | forums-b70a1cc4af7831909b87bc3628ab2a06e8b16b83.tar forums-b70a1cc4af7831909b87bc3628ab2a06e8b16b83.tar.gz forums-b70a1cc4af7831909b87bc3628ab2a06e8b16b83.tar.bz2 forums-b70a1cc4af7831909b87bc3628ab2a06e8b16b83.tar.xz forums-b70a1cc4af7831909b87bc3628ab2a06e8b16b83.zip |
[ticket/12786] Add get_custom_field_id
Adding function to get CPFs ID
PHPBB3-12786
-rw-r--r-- | phpBB/phpbb/db/migration/profilefield_base_migration.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php index 1a88ef0d48..31244bf957 100644 --- a/phpBB/phpbb/db/migration/profilefield_base_migration.php +++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php @@ -112,6 +112,19 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration } /** + * Get custom profile field id + * @return int custom profile filed id + */ + public function get_custom_profile_field_id() + { + $sql = 'SELECT field_id FROM ' . PROFILE_FIELDS_TABLE . ' WHERE field_name = \'' . $this->profilefield_name . '\''; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + + return $field_id; + } + + /** * @param int $start Start of staggering step * @return mixed int start of the next step, null if the end was reached */ |