email = 'test@example.org'; $user->password = $this->passwordHasher->hashPassword($user, self::PASSWORD); $manager->persist($user); $user = new User(); $user->email = 'krtek-admin@example.org'; $user->password = $this->passwordHasher->hashPassword($user, self::PASSWORD); $manager->persist($user); $krtek = $this->getReference(KrtekFixtures::KRTEK_SEASON, Season::class); $krtek->addOwner($user); $anotherSeason = new Season(); $anotherSeason->name = 'Another Season'; $anotherSeason->seasonCode = 'bbbbb'; $manager->persist($anotherSeason); $this->addReference('another-season', $anotherSeason); $user = new User(); $user->email = 'user1@example.org'; $user->password = $this->passwordHasher->hashPassword($user, self::PASSWORD); $manager->persist($user); $user->addSeason($anotherSeason); $user = new User(); $user->email = 'user2@example.org'; $user->password = $this->passwordHasher->hashPassword($user, self::PASSWORD); $manager->persist($user); $krtek->addOwner($user); $anotherSeason->addOwner($user); $manager->flush(); } }