Saving to DB
In your controller:
php $product = new Product(); $product->setName('Keyboard');
$entityManager->persist($product); $entityManager->flush(); // This actually runs the SQL
Symfony 0 to Hero: The Complete 2026 Guide
In your controller:
php $product = new Product(); $product->setName('Keyboard');
$entityManager->persist($product); $entityManager->flush(); // This actually runs the SQL