mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/15594] Convert to short array syntax
PHPBB3-15594
This commit is contained in:
parent
ca2a380d03
commit
269f9251a2
1 changed files with 25 additions and 25 deletions
|
@ -17,45 +17,45 @@ class remove_profilefield_aol extends \phpbb\db\migration\migration
|
||||||
{
|
{
|
||||||
static public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
'\phpbb\db\migration\data\v400\v400',
|
'\phpbb\db\migration\data\v400\v400',
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update_schema()
|
public function update_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
'drop_columns' => array(
|
'drop_columns' => [
|
||||||
$this->table_prefix . 'profile_fields_data' => array(
|
$this->table_prefix . 'profile_fields_data' => [
|
||||||
'pf_phpbb_aol',
|
'pf_phpbb_aol',
|
||||||
),
|
],
|
||||||
),
|
],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function revert_schema()
|
public function revert_schema()
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
'add_columns' => array(
|
'add_columns' => [
|
||||||
$this->table_prefix . 'profile_fields_data' => array(
|
$this->table_prefix . 'profile_fields_data' => [
|
||||||
'pf_phpbb_aol' => array('VCHAR', ''),
|
'pf_phpbb_aol' => ['VCHAR', ''],
|
||||||
),
|
],
|
||||||
),
|
],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update_data()
|
public function update_data()
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
array('custom', array(array($this, 'delete_custom_profile_field_data'))),
|
['custom', [[$this, 'delete_custom_profile_field_data']]],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function revert_data()
|
public function revert_data()
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
array('custom', array(array($this, 'create_custom_field'))),
|
['custom', [[$this, 'create_custom_field']]],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete_custom_profile_field_data()
|
public function delete_custom_profile_field_data()
|
||||||
|
@ -88,7 +88,7 @@ class remove_profilefield_aol extends \phpbb\db\migration\migration
|
||||||
$max_field_order = (int) $this->db->sql_fetchfield('max_field_order');
|
$max_field_order = (int) $this->db->sql_fetchfield('max_field_order');
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
$sql_ary = array(
|
$sql_ary = [
|
||||||
'field_name' => 'phpbb_aol',
|
'field_name' => 'phpbb_aol',
|
||||||
'field_type' => 'profilefields.type.string',
|
'field_type' => 'profilefields.type.string',
|
||||||
'field_ident' => 'phpbb_aol',
|
'field_ident' => 'phpbb_aol',
|
||||||
|
@ -112,7 +112,7 @@ class remove_profilefield_aol extends \phpbb\db\migration\migration
|
||||||
'field_contact_desc' => '',
|
'field_contact_desc' => '',
|
||||||
'field_contact_url' => '',
|
'field_contact_url' => '',
|
||||||
'field_order' => $max_field_order + 1,
|
'field_order' => $max_field_order + 1,
|
||||||
);
|
];
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
|
$sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
|
@ -126,13 +126,13 @@ class remove_profilefield_aol extends \phpbb\db\migration\migration
|
||||||
$lang_name = 'AOL';
|
$lang_name = 'AOL';
|
||||||
while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))
|
while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))
|
||||||
{
|
{
|
||||||
$insert_buffer->insert(array(
|
$insert_buffer->insert([
|
||||||
'field_id' => (int) $field_id,
|
'field_id' => (int) $field_id,
|
||||||
'lang_id' => (int) $lang_id,
|
'lang_id' => (int) $lang_id,
|
||||||
'lang_name' => $lang_name,
|
'lang_name' => $lang_name,
|
||||||
'lang_explain' => '',
|
'lang_explain' => '',
|
||||||
'lang_default_value' => '',
|
'lang_default_value' => '',
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue