php-ddd
php-ddd copied to clipboard
XML mapping for Doctrine MongoDB ODM References Extension
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;
}