jeudi 23 novembre 2017

How to avoid such mistakes: "$entity->save();" and "EntityManager::save($entity);"

I cant describe the problem better. A common mistake is:

$entityModel->save();

instead of:

DoctrineEntityModel::save($entityModel);

the second wins, but I dont know why and most importantly: how to avoid this mixing ups. Something similar with shapes, its ok to have Rectangle.getWidth() but not ok Rectangle.draw but GraphicsSystem.draw(rectangleInstance)!

Aucun commentaire:

Enregistrer un commentaire