Einius
Einius

Reputation: 1382

Symfony2 Doctrine2 make a managed entity unmanaged

If I have multiple managed entities and there is a single entity I don't want it to flush how do I make it unmanaged?

Upvotes: 1

Views: 546

Answers (1)

lxg
lxg

Reputation: 13107

You can detach an entity:

$EntityManager->detach($entity);

But, in most cases, this is not necessary. If you don't explicitly call persist on the entity, modifications won't be stored anyway.

Upvotes: 2

Related Questions