I did some research that Doctrine does not seem to support REPLACE INTO, so I was wondering if there is an equivalent? Is there a way for Doctrine to simply do INSERT INTOif the primary key does not exist?
Sort of:
$em = $this->getDoctrine()->getManager();
$em->replace($entity);
$em->flush();
Or do I need to write this condition? If the entity exists, update, otherwise insert?
source
share