DDC-3096: JoinColumn definition does not regard column type with value translation #3844

Closed
opened 2026-01-22 14:29:00 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 22, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user razorness:

I made a custom column type for doctrine which converts values between MySQL and PHP.

When I use a field with this column type as JoinColumn in a ManyToOne relation plus the column has a different name than the field, the BasicEntityPersister gets always "null" when he is asking for type of the given column name because he is ascing for given column name and not field name.

Example

Make.php:

/****
 @ORM\Column(name="language_code", type="locale")
 */
private $locale;

Foobar.php

/****
 @ORM\ManyToOne(targetEntity="Make")
 @ORM\JoinColumn(name="make*locale", referencedColumnName="language*code")
 */
private $makes;

The localeType translates between long and short language codes. For exmaple "de" (PHP) to "de_DE" (MySQL).

Originally created by @doctrinebot on GitHub (Apr 22, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user razorness: I made a custom column type for doctrine which converts values between MySQL and PHP. When I use a field with this column type as JoinColumn in a ManyToOne relation plus the column has a different name than the field, the BasicEntityPersister gets always "null" when he is asking for type of the given column name because he is ascing for given column name and not field name. # Example Make.php: ``` /**** @ORM\Column(name="language_code", type="locale") */ private $locale; ``` Foobar.php ``` /**** @ORM\ManyToOne(targetEntity="Make") @ORM\JoinColumn(name="make*locale", referencedColumnName="language*code") */ private $makes; ``` The localeType translates between long and short language codes. For exmaple "de" (PHP) to "de_DE" (MySQL).
admin added the Bug label 2026-01-22 14:29:00 +01:00
admin closed this issue 2026-01-22 14:29:00 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 22, 2014):

Comment created by @ocramius:

This is not a blocker, as you're really going into custom implementations.

You should probably provide a failing test case to clarify what you are doing

@doctrinebot commented on GitHub (Apr 22, 2014): Comment created by @ocramius: This is not a blocker, as you're really going into custom implementations. You should probably provide a failing test case to clarify what you are doing
Author
Owner

@doctrinebot commented on GitHub (Nov 4, 2015):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Nov 4, 2015): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Nov 4, 2015):

Comment created by razorness:

Fixed in newer Versions.

@doctrinebot commented on GitHub (Nov 4, 2015): Comment created by razorness: Fixed in newer Versions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3844