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

Challenge 1 / 1

Let's get tricky! Check out the following code:

$product = new Product();
$product->setName('Shuttle Lego Set!');

$entityManager->flush();
$product->setPrice(25);
$entityManager->flush();
$entityManager->persist($product);
$entityManager->flush();
$entityManager->flush();
$product->setPrice(30);
$entityManager->flush();

How many queries did Doctrine make to the database?

Select your answer
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.