DDC-2189: Bidirectional one-to-many association with Class Table Inheritance do not work #2757

Closed
opened 2026-01-22 14:02:34 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 6, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user syao.work:

Bidirectional one-to-many association with Class Table Inheritance does not work. Example.

Entity Box;
Entity Item;
Entity BoxItem extends Item;

BoxItem has ManyToOne to Box;
Box has OneToMany to BoxItems;

Validation Error:
Got an error: Entities\Box: "The association Entities\Box#items refers to the owning side field Entities\BoxItem#box which does not exist.",

Originally created by @doctrinebot on GitHub (Dec 6, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user syao.work: Bidirectional one-to-many association with Class Table Inheritance does not work. Example. Entity Box; Entity Item; Entity BoxItem extends Item; BoxItem has ManyToOne to Box; Box has OneToMany to BoxItems; Validation Error: Got an error: Entities\Box: "The association Entities\Box#items refers to the owning side field Entities\BoxItem#box which does not exist.",
admin added the Bug label 2026-01-22 14:02:34 +01:00
admin closed this issue 2026-01-22 14:02:34 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 6, 2012):

Comment created by @ocramius:

Not a blocker

@doctrinebot commented on GitHub (Dec 6, 2012): Comment created by @ocramius: Not a blocker
Author
Owner

@doctrinebot commented on GitHub (Dec 6, 2012):

Comment created by @ocramius:

[~syao.work] this looks invalid to me.

    /****
     * @MayToOne(targetEntity="Asmuo", inversedBy="items")
     * @JoinColumn(name="box_id", referencedColumnName="id")
     */
    protected $box;

What's Asmuo?

@doctrinebot commented on GitHub (Dec 6, 2012): Comment created by @ocramius: [~syao.work] this looks invalid to me. ``` /**** * @MayToOne(targetEntity="Asmuo", inversedBy="items") * @JoinColumn(name="box_id", referencedColumnName="id") */ protected $box; ``` What's `Asmuo`?
Author
Owner

@doctrinebot commented on GitHub (Dec 6, 2012):

Comment created by syao.work:

Sorry, I did post wrong file BoxItem, my mistake, but the bug persists.

@doctrinebot commented on GitHub (Dec 6, 2012): Comment created by syao.work: Sorry, I did post wrong file BoxItem, my mistake, but the bug persists.
Author
Owner

@doctrinebot commented on GitHub (Dec 6, 2012):

Comment created by @ocramius:

Just checked on my side with attached entities (changed some namespaces, see latest attached files) and everything's fine.
[~syao.work] you got a typo on one of your annotations, which is MayToOne and should be ManyToOne.

@doctrinebot commented on GitHub (Dec 6, 2012): Comment created by @ocramius: Just checked on my side with attached entities (changed some namespaces, see latest attached files) and everything's fine. [~syao.work] you got a typo on one of your annotations, which is `MayToOne` and should be `ManyToOne`.
Author
Owner

@doctrinebot commented on GitHub (Dec 24, 2012):

Comment created by @beberlei:

Error caused by Invalid mapping

@doctrinebot commented on GitHub (Dec 24, 2012): Comment created by @beberlei: Error caused by Invalid mapping
Author
Owner

@doctrinebot commented on GitHub (Dec 24, 2012):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Dec 24, 2012): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2757