mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-21 03:14:52 +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
|
@ -55,10 +55,11 @@ use App\Entity\PriceInformations\Pricedetail;
|
|||
use Brick\Math\BigDecimal;
|
||||
use DateTime;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class PartFixtures extends Fixture
|
||||
class PartFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
public function __construct(protected EntityManagerInterface $em)
|
||||
{
|
||||
|
@ -132,4 +133,11 @@ class PartFixtures extends Fixture
|
|||
$manager->persist($part);
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
public function getDependencies(): array
|
||||
{
|
||||
return [
|
||||
DataStructureFixtures::class
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue