mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix loading third party
This commit is contained in:
parent
0633fd812f
commit
72e9346b6b
@ -21,13 +21,14 @@ class LoadThirdParty extends Fixture Implements DependentFixtureInterface
|
||||
$thirdParties = $this->getThirdParties()->getObjects();
|
||||
|
||||
foreach ($thirdParties as $name => $thirdParty) {
|
||||
if ('a' === $name[0]) {
|
||||
if ('a' === $name[0]) {
|
||||
// this is an address
|
||||
continue;
|
||||
}
|
||||
$thirdParty->setCreatedAt(new \DateTimeImmutable('today'));
|
||||
|
||||
foreach ($this->getCenters() as $center) {
|
||||
$thirdParty->addCenter($center);
|
||||
$thirdParty->addCenter($center);
|
||||
}
|
||||
|
||||
$manager->persist($thirdParty);
|
||||
@ -38,7 +39,7 @@ class LoadThirdParty extends Fixture Implements DependentFixtureInterface
|
||||
|
||||
private function getCenters(): \Iterator
|
||||
{
|
||||
$references = \array_map(function($a) { return $a['ref']; },
|
||||
$references = \array_map(function($a) { return $a['ref']; },
|
||||
LoadCenters::$centers);
|
||||
$number = random_int(1, count($references));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user