mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 04:56:13 +00:00
Remove containerAwareInterface, no longer supported in sf72
This commit is contained in:
parent
46f9e4968b
commit
ebaff8d170
@ -14,13 +14,9 @@ namespace Chill\Migrations\Budget;
|
|||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\DBAL\Types\Types;
|
use Doctrine\DBAL\Types\Types;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
||||||
|
|
||||||
final class Version20221207105407 extends AbstractMigration implements ContainerAwareInterface
|
final class Version20221207105407 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public ContainerInterface $container;
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->addSql('DELETE FROM chill_budget.resource_type;');
|
$this->addSql('DELETE FROM chill_budget.resource_type;');
|
||||||
@ -32,14 +28,9 @@ final class Version20221207105407 extends AbstractMigration implements Container
|
|||||||
return 'Use new budget admin entities';
|
return 'Use new budget admin entities';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setContainer(?ContainerInterface $container = null): void
|
|
||||||
{
|
|
||||||
$this->container = $container;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$resources = $this->container->getParameter('chill_budget.resources');
|
/* $resources = $this->container->getParameter('chill_budget.resources');
|
||||||
$charges = $this->container->getParameter('chill_budget.charges');
|
$charges = $this->container->getParameter('chill_budget.charges');
|
||||||
|
|
||||||
foreach ($resources as $value) {
|
foreach ($resources as $value) {
|
||||||
@ -76,6 +67,6 @@ final class Version20221207105407 extends AbstractMigration implements Container
|
|||||||
['kind' => $kind],
|
['kind' => $kind],
|
||||||
['kind' => Types::STRING]
|
['kind' => Types::STRING]
|
||||||
);
|
);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,7 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
|
|||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load countries into database.
|
* Load countries into database.
|
||||||
|
@ -13,11 +13,8 @@ namespace Chill\MainBundle\DataFixtures\ORM;
|
|||||||
|
|
||||||
use Chill\MainBundle\Entity\Language;
|
use Chill\MainBundle\Entity\Language;
|
||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load languages into database.
|
* Load languages into database.
|
||||||
|
@ -16,7 +16,6 @@ use Chill\MainBundle\Entity\User;
|
|||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,13 +14,9 @@ namespace Chill\Migrations\Main;
|
|||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use libphonenumber\PhoneNumberUtil;
|
use libphonenumber\PhoneNumberUtil;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
|
||||||
|
|
||||||
final class Version20220302132728 extends AbstractMigration implements ContainerAwareInterface
|
final class Version20220302132728 extends AbstractMigration
|
||||||
{
|
{
|
||||||
use ContainerAwareTrait;
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(64)');
|
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(64)');
|
||||||
@ -38,11 +34,10 @@ final class Version20220302132728 extends AbstractMigration implements Container
|
|||||||
|
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$carrier_code = $this->container
|
$carrierCode = getenv('DEFAULT_CARRIER_CODE');
|
||||||
->getParameter('chill_main')['phone_helper']['default_carrier_code'];
|
|
||||||
|
|
||||||
if (null === $carrier_code) {
|
if (!$carrierCode) {
|
||||||
throw new \RuntimeException('no carrier code');
|
throw new \RuntimeException('Environment variable DEFAULT_CARRIER_CODE is not set.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(35)');
|
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(35)');
|
||||||
@ -56,9 +51,9 @@ final class Version20220302132728 extends AbstractMigration implements Container
|
|||||||
|
|
||||||
$this->addSql(
|
$this->addSql(
|
||||||
'UPDATE chill_main_location SET '.
|
'UPDATE chill_main_location SET '.
|
||||||
$this->buildMigrationPhonenumberClause($carrier_code, 'phonenumber1').
|
$this->buildMigrationPhonenumberClause($carrierCode, 'phonenumber1').
|
||||||
', '.
|
', '.
|
||||||
$this->buildMigrationPhoneNumberClause($carrier_code, 'phonenumber2')
|
$this->buildMigrationPhoneNumberClause($carrierCode, 'phonenumber2')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,6 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
|
|||||||
use Faker\Generator;
|
use Faker\Generator;
|
||||||
use Nelmio\Alice\Loader\NativeLoader;
|
use Nelmio\Alice\Loader\NativeLoader;
|
||||||
use Nelmio\Alice\ObjectSet;
|
use Nelmio\Alice\ObjectSet;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\Workflow\Registry;
|
use Symfony\Component\Workflow\Registry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,8 +45,6 @@ use Symfony\Component\Workflow\Registry;
|
|||||||
*/
|
*/
|
||||||
class LoadPeople extends Fixture implements OrderedFixtureInterface
|
class LoadPeople extends Fixture implements OrderedFixtureInterface
|
||||||
{
|
{
|
||||||
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
|
||||||
|
|
||||||
final public const PERSON = 'person';
|
final public const PERSON = 'person';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -14,13 +14,9 @@ namespace Chill\Migrations\Person;
|
|||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use libphonenumber\PhoneNumberUtil;
|
use libphonenumber\PhoneNumberUtil;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
|
||||||
|
|
||||||
final class Version20220215135509 extends AbstractMigration implements ContainerAwareInterface
|
final class Version20220215135509 extends AbstractMigration
|
||||||
{
|
{
|
||||||
use ContainerAwareTrait;
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
throw new \Exception('You should not do that.');
|
throw new \Exception('You should not do that.');
|
||||||
@ -33,11 +29,10 @@ final class Version20220215135509 extends AbstractMigration implements Container
|
|||||||
|
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$carrier_code = $this->container
|
$carrierCode = getenv('DEFAULT_CARRIER_CODE'); // Directly from the .env
|
||||||
->getParameter('chill_main')['phone_helper']['default_carrier_code'];
|
|
||||||
|
|
||||||
if (null === $carrier_code) {
|
if (!$carrierCode) {
|
||||||
throw new \RuntimeException('no carrier code');
|
throw new \RuntimeException('Environment variable DEFAULT_CARRIER_CODE is not set.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_person_person ALTER phonenumber TYPE TEXT');
|
$this->addSql('ALTER TABLE chill_person_person ALTER phonenumber TYPE TEXT');
|
||||||
@ -52,9 +47,9 @@ final class Version20220215135509 extends AbstractMigration implements Container
|
|||||||
|
|
||||||
$this->addSql(
|
$this->addSql(
|
||||||
'UPDATE chill_person_person SET '.
|
'UPDATE chill_person_person SET '.
|
||||||
$this->buildMigrationPhonenumberClause($carrier_code, 'phonenumber').
|
$this->buildMigrationPhonenumberClause($carrierCode, 'phonenumber').
|
||||||
', '.
|
', '.
|
||||||
$this->buildMigrationPhoneNumberClause($carrier_code, 'mobilenumber')
|
$this->buildMigrationPhoneNumberClause($carrierCode, 'mobilenumber')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_person_phone ALTER phonenumber TYPE TEXT');
|
$this->addSql('ALTER TABLE chill_person_phone ALTER phonenumber TYPE TEXT');
|
||||||
@ -64,7 +59,7 @@ final class Version20220215135509 extends AbstractMigration implements Container
|
|||||||
|
|
||||||
$this->addSql(
|
$this->addSql(
|
||||||
'UPDATE chill_person_phone SET '.
|
'UPDATE chill_person_phone SET '.
|
||||||
$this->buildMigrationPhoneNumberClause($carrier_code, 'phonenumber')
|
$this->buildMigrationPhoneNumberClause($carrierCode, 'phonenumber')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,16 +14,12 @@ namespace Chill\Migrations\Report;
|
|||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a scope to report.
|
* Add a scope to report.
|
||||||
*/
|
*/
|
||||||
class Version20150622233319 extends AbstractMigration implements ContainerAwareInterface
|
class Version20150622233319 extends AbstractMigration
|
||||||
{
|
{
|
||||||
private ?ContainerInterface $container = null;
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf(
|
$this->abortIf(
|
||||||
@ -37,15 +33,6 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI
|
|||||||
$this->addSql('ALTER TABLE Report DROP scope_id');
|
$this->addSql('ALTER TABLE Report DROP scope_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setContainer(?ContainerInterface $container = null): void
|
|
||||||
{
|
|
||||||
if (null === $container) {
|
|
||||||
throw new \RuntimeException('Container is not provided. This migration need container to set a default center');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->container = $container;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$this->abortIf(
|
$this->abortIf(
|
||||||
|
@ -14,12 +14,9 @@ namespace Chill\Migrations\ThirdParty;
|
|||||||
use Doctrine\DBAL\Schema\Schema;
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
use libphonenumber\PhoneNumberUtil;
|
use libphonenumber\PhoneNumberUtil;
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
|
||||||
|
|
||||||
final class Version20220302143821 extends AbstractMigration implements ContainerAwareInterface
|
final class Version20220302143821 extends AbstractMigration
|
||||||
{
|
{
|
||||||
use ContainerAwareTrait;
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
public function down(Schema $schema): void
|
||||||
{
|
{
|
||||||
@ -35,11 +32,10 @@ final class Version20220302143821 extends AbstractMigration implements Container
|
|||||||
|
|
||||||
public function up(Schema $schema): void
|
public function up(Schema $schema): void
|
||||||
{
|
{
|
||||||
$carrier_code = $this->container
|
$carrierCode = getenv('DEFAULT_CARRIER_CODE'); // Directly from the .env
|
||||||
->getParameter('chill_main')['phone_helper']['default_carrier_code'];
|
|
||||||
|
|
||||||
if (null === $carrier_code) {
|
if (!$carrierCode) {
|
||||||
throw new \RuntimeException('no carrier code');
|
throw new \RuntimeException('Environment variable DEFAULT_CARRIER_CODE is not set.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_3party.third_party ALTER telephone TYPE VARCHAR(35)');
|
$this->addSql('ALTER TABLE chill_3party.third_party ALTER telephone TYPE VARCHAR(35)');
|
||||||
@ -49,7 +45,7 @@ final class Version20220302143821 extends AbstractMigration implements Container
|
|||||||
|
|
||||||
$this->addSql(
|
$this->addSql(
|
||||||
'UPDATE chill_3party.third_party SET '.
|
'UPDATE chill_3party.third_party SET '.
|
||||||
$this->buildMigrationPhonenumberClause($carrier_code, 'telephone')
|
$this->buildMigrationPhonenumberClause($carrierCode, 'telephone')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user