Doctrine, Symfony 6 & the Database
Persisting to the Database
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 1 / 1

Here's a tricky question. Check out this code where we persist and flush twice!

$mix = new VinylMix();
// setting data

$entityManager->persist($mix);
$entityManager->flush();

// do it again!
$entityManager->persist($mix);
$entityManager->flush();

What do you think the second persist/flush will do?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.