From 72e9346b6be179ee60120b2e6be69e0f304aedd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 8 Oct 2021 17:56:13 +0200 Subject: [PATCH] fix loading third party --- .../DataFixtures/ORM/LoadThirdParty.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 7fc5ea1c8..1d343f1fd 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -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));