doctrine / couchdb-odm

A Document Mapper based on CouchDB
http://www.doctrine-project.org
MIT License
150 stars 53 forks source link

Embedded entities #149

Open itcreator opened 6 years ago

itcreator commented 6 years ago

Hello I have a question about couchdb-odm Is it possible to make embedded entities like doctrine-orm?

/** @Entity */
class User
{
    /** @Embedded(class = "Address") */
    private $address;
}

/** @Embeddable */
class Address
{
    /** @Column(type = "string") */
    private $street;

    /** @Column(type = "string") */
    private $postalCode;

    /** @Column(type = "string") */
    private $city;

    /** @Column(type = "string") */
    private $country;
}

If yes could you provide an example?

Ocramius commented 6 years ago

See https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/1.2/reference/annotations-reference.html#embedone

Sorry, misread the question :-\