php-ddd icon indicating copy to clipboard operation
php-ddd copied to clipboard

XML mapping for Doctrine MongoDB ODM References Extension

Open webdevilopers opened this issue 9 years ago • 0 comments

Coming from:

  • https://github.com/Atlantic18/DoctrineExtensions/issues/1564#issue-148766564 @l3pp4rd
  • https://github.com/Atlantic18/DoctrineExtensions/issues/750#issuecomment-214837100 @stof
  • https://twitter.com/webdevilopers/status/720290618249912320

I never got it working on the Document side - don't know if the XML mapping is complete anyway:

http://atlantic18.github.io/DoctrineExtensions/schemas/orm/doctrine-extensions-3.0.xsd


namespace Acme\AppBundle\Entity;

class Customer
{
    /**
     * @Gedmo\ReferenceMany(type="document", class="Acme\DomainModel\Order", mappedBy="customer")
     */
    private $orders;
}
        <field fieldName="customerId" type="integer" />
        <gedmo:reference type="entity"
             class="Acme\AppBundle\Entity\Customer"
             inversed-by="orders" identifier="customerId" />

namespace Acme\DomainModel;

class Order
{
    private $customer;
    private $customerId;
}

webdevilopers avatar May 03 '16 09:05 webdevilopers