couchdb-odm icon indicating copy to clipboard operation
couchdb-odm copied to clipboard

cannot EmbedOne a Document with ReferenceOne or ReferenceMany properties in it

Open chatzipan opened this issue 10 years ago • 2 comments

Hi all. Im new in programming and couchdb-odm. I have the following problem:

I have a Document A in which I'm trying to embedOne another Document B which is already existing in my Database, and which has some ReferenceOne and ReferenceMany properties pointing at some Documents C and D respectively.

I get an error: Undefined index: parent in /vendor/doctrine/couchdb-odm/lib/Doctrine/ODM/CouchDB/Mapping/EmbeddedDocumentSerializer.php on line 84

Am I doing something wrong? Thanks in advance.

chatzipan avatar Feb 02 '15 23:02 chatzipan

Same problem here! Document Plan embeds one document Store Document Store references many documents Users Document Users references many documents Stores (User::$stores is mappedBy="users")

Both Store::$users and User::$stores are indexed by @Index.

When I create Documents Store and Users, all good. But when I try to create Plan I get the error Undefined index: users

screen shot 2016-03-24 at 09 08 59

mateusgf avatar Mar 24 '16 12:03 mateusgf

Hello, I guess I have the same problem.

I wrote a temporary fix (but with code duplication) : #137

I hope this will help. ;)

ghost avatar Feb 27 '17 09:02 ghost