I have a symfony function that returns a rest api. I can successfully send data to a new record from the endpoint. This is a symfony controller as shown
$users->setUsername($request->request->get('username'));
$users->setPhonenumber($request->request->get('phonenumber'));
$users->setEmail($request->request->get('email'));
$users->setPassword($request->request->get('password'));
$users->setDateregistered(new \DateTime('now'));
$em->persist($users);
$em->flush();
Assuming the above inserts a new record into a new table, my task is to get the primary key of this table.
Float source
share