Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-930

A table cannot have more than one many to many relationship with the same table when using reverse engineer

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0-RC2
    • Fix Version/s: None
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None
    • Environment:
      FreeBSD, PostgreSQL 8.4

      Description

      This is caused by taking the join column name as the identifier while generating a property name for annotation. The mapping driver detects that the same property is already defined and ends the convert process. A little bit smarter approach for me was to take the local table name. But this assumes a specific style of join table naming convention.

      Doctrine\ORM\Mapping\Driver\DatabaseDriver::loadMetadataForClass()

      Replace:

      $associationMapping['fieldName'] = Inflector::camelize(str_replace('_id', '', strtolower(current($otherFk->getColumns()))));

      With:

      $name = explode("_",$myFk->getLocalTableName());
      if (count($name) > 1)
      {
      array_shift($name);
      }
      $name = implode("_", $name);

      $associationMapping['fieldName'] = Inflector::camelize(str_replace('_id', '', strtolower($name)));

      Maybe to switch to this behavior with an additional option?

        Activity

        Jiri Helmich created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 12225 ] jira-feedback [ 13889 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13889 ] jira-feedback2 [ 15753 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15753 ] jira-feedback3 [ 18010 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-930, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Jiri Helmich
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: