I have the following reference in my class:
/**
* @Expose
* @Groups({"personal"})
*
* @MongoDB\ReferenceMany(targetDocument="AppBundle\Document\Correspondence", cascade={"remove"})
*/
protected $archiveCorrespondences;
And I want to save this reference in my database under the name archive_correspondences But whatever I did, doctrine always keeps it under archiveCorrespondences
I use the following:
From the doctrine mongodb documentation I did't find any possibilities, like for @Field annotation
, where you can specify name. By some reasons I can't rename $archiveCorrespondences
to $archive_correspondences
in code.
I suggest you to try name
property. It should work for ReferenceMany
:
/**
* @Expose
* @Groups({"personal"})
*
* @MongoDB\ReferenceMany(name="archive_correspondences", targetDocument="AppBundle\Document\Correspondence", cascade={"remove"})
*/
protected $archiveCorrespondences;