This is just a convenient shortcut for getRepository($entityName)->find($id).
use Doctrine\ORM\EntityManager; use App\Entity\User; // Create a new instance of the EntityManager class $entityManager = EntityManager::create($connectionParams, $config); // Retrieve the User entity with ID 1 $user = $entityManager->find(User::class, 1); // Output the user's name echo $user->getName();In this example, we first create a new instance of the EntityManager class using connection parameters and configuration. Then, we use the "find" method to retrieve a User entity with ID 1, and output the user's name. The Doctrine ORM library is a mature and widely-used package for object-relational mapping in PHP.