Skip to content

Commit

Permalink
Add 2nd parameter (class) to getReference() call
Browse files Browse the repository at this point in the history
Since Doctrine data fixture v2, getReference() requires a second parameter, being the class
  • Loading branch information
olberger authored Dec 3, 2024
1 parent c85fb52 commit 33bc99a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ exact same object via its name.
{
$userGroup = new Group('administrators');
// this reference returns the User object created in UserFixtures
$userGroup->addUser($this->getReference(UserFixtures::ADMIN_USER_REFERENCE));
$userGroup->addUser($this->getReference(UserFixtures::ADMIN_USER_REFERENCE, User::class));
$manager->persist($userGroup);
$manager->flush();
Expand Down

0 comments on commit 33bc99a

Please sign in to comment.