mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +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();
|
$thirdParties = $this->getThirdParties()->getObjects();
|
||||||
|
|
||||||
foreach ($thirdParties as $name => $thirdParty) {
|
foreach ($thirdParties as $name => $thirdParty) {
|
||||||
if ('a' === $name[0]) {
|
if ('a' === $name[0]) {
|
||||||
// this is an address
|
// this is an address
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$thirdParty->setCreatedAt(new \DateTimeImmutable('today'));
|
||||||
|
|
||||||
foreach ($this->getCenters() as $center) {
|
foreach ($this->getCenters() as $center) {
|
||||||
$thirdParty->addCenter($center);
|
$thirdParty->addCenter($center);
|
||||||
}
|
}
|
||||||
|
|
||||||
$manager->persist($thirdParty);
|
$manager->persist($thirdParty);
|
||||||
@ -38,7 +39,7 @@ class LoadThirdParty extends Fixture Implements DependentFixtureInterface
|
|||||||
|
|
||||||
private function getCenters(): \Iterator
|
private function getCenters(): \Iterator
|
||||||
{
|
{
|
||||||
$references = \array_map(function($a) { return $a['ref']; },
|
$references = \array_map(function($a) { return $a['ref']; },
|
||||||
LoadCenters::$centers);
|
LoadCenters::$centers);
|
||||||
$number = random_int(1, count($references));
|
$number = random_int(1, count($references));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user