Closed
Description
ATM, the generated code is:
public function add(Message $entity, bool $flush = true): void
{
$this->_em->persist($entity);
if ($flush) {
$this->_em->flush();
}
}
This is a bad idea:
- it's confusing: one may thing it will flush only the new message (it's not!)
- flush should be done in the most outside layer of the application (controller, command, message handler) to avoid flushing invalid data
Metadata
Metadata
Assignees
Labels
No labels