Doctrine 1
  1. Doctrine 1
  2. DC-777

getConnectionForComponent and bindComponent are case sensitive

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Connection
    • Labels:
      None
    • Environment:
      Symfony 1.4.x
      sfDoctrinePlugin

      Description

      When using multiple database connections, the sfDoctrinePlugin for Symfony 1.4.x is case sensitive when looking up the connection for a model / component while the Symfony is not.

      This causes code to function correct even when the model names are used in lower case. Once a second connection is configured, the model name is registered in upper case via the base-class (as per the naming convention) causing the wrong connection to be chosen when the model is referenced in lower case.

      This:

       
      $componentName = 'Country';
      
      $this->_bound[$componentName] = $connectionName;
      

      Will result in no connection found for:

       
      $componentName = 'country';
      
      if (isset($this->_bound[$componentName])) {
                  return $this->getConnection($this->_bound[$componentName]);
              }
      

      Unless this was purposely designed to be case-sensitive, I think this should be changed to prevent confusion since in general PHP is not case sensitive when dealing with variable names.

      This bug is related to http://www.doctrine-project.org/jira/browse/DC-740

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Marcel Berteler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: