الحفظ في قاعدة البيانات
داخل المتحكم (controller) الخاص بك:
php $product = new Product(); $product->setName('Keyboard');
$entityManager->persist($product); $entityManager->flush(); // هنا يتم تنفيذ استعلام SQL فعلياً
إتقان Symfony من الصفر إلى الاحتراف: الدليل الشامل لعام 2026
داخل المتحكم (controller) الخاص بك:
php $product = new Product(); $product->setName('Keyboard');
$entityManager->persist($product); $entityManager->flush(); // هنا يتم تنفيذ استعلام SQL فعلياً