DDC-383: Setting Column name doesn't work predictably in associations #478

Open
opened 2026-01-22 12:39:36 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 27, 2010).

Jira issue originally created by user kanundrum:

Setting a column name that is different from the property name yields errors in associations (e.g. in a one to one association I get "Undefined index: shipping_id in /var/www/wetawa/library/Doctrine/ORM/UnitOfWork.php on line 1782 Call ")

...
    /****
     * @Column(type="bigint", name="shipping_id")
     *
     * @var integer
     */
    protected $shippingId=0;
    /****
     * @OneToOne(targetEntity="Shipping")
     * @JoinColumn(name="shipping_id", referencedColumnName="id")
     * 
     * @var Shipping
     */
    protected $shipping;

The only way I've been able to get associations to work is by using the default naming so $shipping_id instead of $shippingId

Originally created by @doctrinebot on GitHub (Feb 27, 2010). Jira issue originally created by user kanundrum: Setting a column name that is different from the property name yields errors in associations (e.g. in a one to one association I get "Undefined index: shipping_id in /var/www/wetawa/library/Doctrine/ORM/UnitOfWork.php on line 1782 Call ") ``` ... /**** * @Column(type="bigint", name="shipping_id") * * @var integer */ protected $shippingId=0; /**** * @OneToOne(targetEntity="Shipping") * @JoinColumn(name="shipping_id", referencedColumnName="id") * * @var Shipping */ protected $shipping; ``` The only way I've been able to get associations to work is by using the default naming so $shipping_id instead of $shippingId
admin added the Improvement label 2026-01-22 12:39:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#478