doctrine/mongodb-odm — pull request #402 by extr3m0 (2012-08-30 18:29:38+00:00)
Title: Added support for custom ID generators

I think it is really important to be able to create custom IDs. For that reason a modified the ClassMetaFactory to support this.

When using a custom generator the annotation for the ID would look like this:

```PHP
/** @Id(strategy="custom",options={
* "class"="MyGeneratorClass",
* "someOption"="myValue"
* }) */
protected $id;
```

The customer generator class would have to be of the type AbstractIdGenerator:
```PHP
class MyGeneratorClass extends Doctrine\ODM\MongoDB\Id\AbstractIdGenerator
{
public function generate(\Doctrine\ODM\MongoDB\DocumentManager $dm, $document)
{
$id = "..."; // Should be 24 hex chars
return new \MongoId($id);
}

public function setSomeOption($value)
{
// $value = "myValue"
}
}
```

Could some please check if this is compatible with XML, YAML, ...! Thanks!