mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-17 19:28:06 +00:00
Pass class as second parameter to getReference() fixture method
This commit is contained in:
@@ -12,9 +12,11 @@ declare(strict_types=1);
|
||||
namespace Chill\EventBundle\DataFixtures\ORM;
|
||||
|
||||
use Chill\EventBundle\Entity\Event;
|
||||
use Chill\EventBundle\Entity\EventType;
|
||||
use Chill\EventBundle\Entity\Participation;
|
||||
use Chill\MainBundle\DataFixtures\ORM\LoadScopes;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
@@ -44,12 +46,12 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa
|
||||
$event = (new Event())
|
||||
->setDate($this->faker->dateTimeBetween('-2 years', '+6 months'))
|
||||
->setName($this->faker->words(random_int(2, 4), true))
|
||||
->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)], null))
|
||||
->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)], EventType::class))
|
||||
->setCenter($center)
|
||||
->setCircle(
|
||||
$this->getReference(
|
||||
LoadScopes::$references[array_rand(LoadScopes::$references)],
|
||||
null
|
||||
Scope::class
|
||||
)
|
||||
);
|
||||
$manager->persist($event);
|
||||
|
||||
Reference in New Issue
Block a user