Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-936

Doctrine type not found exception thrown before checking the comment

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: Schema Managers
    • Security Level: All
    • Labels:

      Description

      Here is the piece of code:

      $type = $this->_platform->getDoctrineTypeMapping($dbType);
      
      // In cases where not connected to a database DESCRIBE $table does not return 'Comment'
      if (isset($tableColumn['comment'])) {
          $type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type);
          $tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type);
      }
      

      The method `getDoctrineTypeMapping` throw an exception if the type is not found. But for example if you have an enum type (see the doctrine cookbook on the subject), the type is setted as comment.

      Doctrine throw the exception before having the occasion to get the type via comment.

      Here are two solutions:

      • Check for comment before throw the exception
      • Adding the enum type to the doctrine platform and mapping it to string

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Maxime Veber
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: