Skip to content

ODM double properties for ORM mapping #750

@ghost

Description

Hi,

This is not a bug but a possible improvement :

  • I have a User Document who has a Customer Entity reference. Code is like this :

    /**
     * @var Customer
     * @Gedmo\ReferenceOne(type="entity", class="Customer", identifier="customerId")
     */
    protected $customer;
    
    /**
     * @ODM\Field(type="int")
     */
    protected $customerId;
    

I don't understand why i have to create two properties for that. When i set $customer, i have to set $customerId with the good value to avoid difference. The plugin should be able to map $customer with mongo property customerId without use document property $customerId. Same working as native orm mapping :)

I repeat me : it's not critical, it's perhaps hard to do, but i think it's better.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions