Skip to content

Processing data

Apodemus Erectus edited this page Jun 10, 2020 · 16 revisions

This guide is about fetching data from your database and sending data to your database using Symfony.

The EntityManager

"The EntityManager is your friend. He can fetch data, send data, a really good guy overall." - Bryan Kho

This is the EntityManager, it can fetch data and send data from and to your database. You can access the Entity Manager from your controller.

$entityManager = $this->getDoctrine()->getManager();

You can also access the EntityManager via the EntityManagerInterface object, which you can add as an argument to your method inside your controller.

// don't forget the import
use Doctrine\ORM\EntityManagerInterface;

yourMethod(EntityManagerInterface $entityManager) {

}

fetch data

W.I.P.

Clone this wiki locally