doctrine/couchdb-odm — Issue #35: forcing the document ID fails with "Detached document passed to persist()"
Author: georgiana-gligor
Created: 2011-11-15 21:23:50+00:00
State: open

I am trying to add a document using an Id that is chosen by my application, not by the odm.
```/**
* @CouchDB\Document(indexed=true)
*/
class TestCouch
{

/** @CouchDB\Id(type="string") */
public $id;

/** @CouchDb\Field(type="string") */
public $contents;
// ... etc
}
```

I use
```
$obj = new TestCouch();
$obj->setId('test-123'); // commenting this line will work, but I will receive an ID automatically, not what I want
$obj->setContents($data);
$documentManager->persist($obj);
$documentManager->flush();
```

## Expected behaviour
Document is saved with `_id` value of `test-123`

## Actual behaviour
The error I receive is ` Detached document passed to persist(). ` which in Symfony2 also translates into a `500 Internal Server Error`.