mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-04 04:19:43 +00:00
Remove ContainerAwareInterface and extend Fixture instead
This commit is contained in:
@@ -13,11 +13,10 @@ namespace Chill\MainBundle\DataFixtures\ORM;
|
||||
|
||||
use Chill\MainBundle\Entity\GroupCenter;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
||||
|
||||
/**
|
||||
@@ -26,7 +25,7 @@ use Symfony\Component\Security\Core\Encoder\EncoderFactory;
|
||||
* create a user for each permission_group and center.
|
||||
* username and password are identicals.
|
||||
*/
|
||||
class LoadUsers extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface
|
||||
class LoadUsers extends Fixture implements OrderedFixtureInterface
|
||||
{
|
||||
public static $refs = [
|
||||
'center a_social' => [
|
||||
@@ -52,9 +51,6 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde
|
||||
'centerB_permission_group_social', ],
|
||||
],
|
||||
];
|
||||
|
||||
private ?ContainerInterface $container = null;
|
||||
|
||||
public function getOrder(): int
|
||||
{
|
||||
return 1000;
|
||||
@@ -91,13 +87,4 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
public function setContainer(?ContainerInterface $container = null): void
|
||||
{
|
||||
if (null === $container) {
|
||||
throw new \LogicException('$container should not be null');
|
||||
}
|
||||
|
||||
$this->container = $container;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user