actualy we can do this on already managed entity object:
```
If X is a preexisting managed entity, it is ignored by the persist operation. However, the persist operation is cascaded to entities referenced by X, if the relationships from X to these other entities are mapped with cascade=PERSIST or cascade=ALL (see “Transitive Persistence”).
```

but we must always have in mind that referenced entities. So you can remove that $id checking on persist.