Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2012

Inserting a new entity with a custom mapping type does not call convertToDatabaseValueSQL() when using InheritanceType("JOINED")

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.3.1
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None
    • Environment:
      PHP

      Description

      When using class type inheritance - @InheritanceType("JOINED") and inserting new entity with a custom mapping type, custom type method convertToDatabaseValueSQL() is never called.

      Here is sample class mapping:

      Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
       
      /**
       * @Table(name="item")
       * @Entity
       * @InheritanceType("JOINED")
       * @DiscriminatorColumn(name="type_id", type="smallint")
       * @DiscriminatorMap({1 = "ItemPerson"})
       */
      class Item {
      
      	/**
      	 * @Column(name="tsv", type="tsvector", nullable=true)
      	 */
      	protected $tsv;
      }
      
      /**
       * @Table(name="item_person")
       * @Entity
       */
      class ItemPerson extends Item
      {
      }
      
      

      I am using the same custom TsvectorType with simple entities and even Mapped Superclasses and it works perfectly, however on InheritanceType("JOINED") method convertToDatabaseValueSQL() is never called :/
      Hope someone knows how to fix this.
      Thank you.

      1. DDC2012Test.php
        4 kB
        Kaspars Sproģis
      2. DDC2012Test.php
        4 kB
        Fabio B. Silva

        Activity

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Kaspars Sproģis
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: