couchdb-odm icon indicating copy to clipboard operation
couchdb-odm copied to clipboard

Set "type" for document

Open likebtn opened this issue 10 years ago • 1 comments

Bundle saves and searches documents with the type field which equals to the document class name, for example "Acme.DemoBundle.CouchDocument.Settings".

Is there any way to set custom "type", for example:

/**
* @CouchDB\Document(type="Settings")
*/
class Settings
{
  /**
   * @CouchDB\Id
   */
  protected $id;
}

likebtn avatar Aug 20 '14 16:08 likebtn

Doctrine MongoDB ODM uses a customisable discriminator map, which does just this. Maybe a similar feature could be implemented in Doctrine CouchDB ODM?

SteveTalbot avatar Sep 14 '14 12:09 SteveTalbot