mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-06 19:25:28 +02:00
Specify order in which the data fixtures should be loaded
This commit is contained in:
parent
4977f6c270
commit
cce3e1cfb8
5 changed files with 36 additions and 41 deletions
|
@ -24,11 +24,12 @@ namespace App\DataFixtures;
|
|||
|
||||
use App\Entity\UserSystem\User;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
|
||||
class UserFixtures extends Fixture
|
||||
class UserFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
public function __construct(protected UserPasswordHasherInterface $encoder, protected EntityManagerInterface $em)
|
||||
{
|
||||
|
@ -66,4 +67,11 @@ class UserFixtures extends Fixture
|
|||
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
public function getDependencies(): array
|
||||
{
|
||||
return [
|
||||
GroupFixtures::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue