Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-3096

JoinColumn definition does not regard column type with value translation

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: ORM
    • Environment:
      Symfony 2.4.3

      Description

      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).

        Activity

        Hide
        Marco Pivetta added a comment -

        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

        Show
        Marco Pivetta added a comment - 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

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Volker Nauruhn
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: