aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/migration/profilefield_base_migration.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2015-01-14 12:07:53 +0100
committerTristan Darricau <github@nicofuma.fr>2015-01-14 12:16:24 +0100
commitce47170c29f4bd7b6a9a4dc74f95be5b4241872d (patch)
treecb838ecb6562829250c4e287be0a894b46616365 /phpBB/phpbb/db/migration/profilefield_base_migration.php
parent4df125625c7df93a5c3727a3cfd9517df4ba0ba6 (diff)
downloadforums-ce47170c29f4bd7b6a9a4dc74f95be5b4241872d.tar
forums-ce47170c29f4bd7b6a9a4dc74f95be5b4241872d.tar.gz
forums-ce47170c29f4bd7b6a9a4dc74f95be5b4241872d.tar.bz2
forums-ce47170c29f4bd7b6a9a4dc74f95be5b4241872d.tar.xz
forums-ce47170c29f4bd7b6a9a4dc74f95be5b4241872d.zip
[ticket/13489] Update migrations
PHPBB3-13489
Diffstat (limited to 'phpBB/phpbb/db/migration/profilefield_base_migration.php')
-rw-r--r--phpBB/phpbb/db/migration/profilefield_base_migration.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php
index 9000949a7d..02954d109c 100644
--- a/phpBB/phpbb/db/migration/profilefield_base_migration.php
+++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php
@@ -13,7 +13,10 @@
namespace phpbb\db\migration;
-abstract class profilefield_base_migration extends \phpbb\db\migration\migration
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+abstract class profilefield_base_migration extends \phpbb\db\migration\migration implements ContainerAwareInterface
{
protected $profilefield_name;
@@ -40,6 +43,11 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
protected $user_column_name;
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
public function effectively_installed()
{
return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields_data', 'pf_' . $this->profilefield_name);
@@ -237,11 +245,18 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
if ($profile_row === null)
{
- global $phpbb_container;
- $manager = $phpbb_container->get('profilefields.manager');
+ $manager = $this->container->get('profilefields.manager');
$profile_row = $manager->build_insert_sql_array(array());
}
return $profile_row;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContainer(ContainerInterface $container = null)
+ {
+ $this->container = $container;
+ }
}