Changeset 4595

Show
Ignore:
Timestamp:
06/29/08 06:19:44 (12 months ago)
Author:
jwage
Message:

fixes #1124

Location:
branches/0.11
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Table.php

    r4573 r4595  
    953953        } 
    954954 
    955         return $fieldName; 
     955        return strtolower($fieldName); 
    956956    } 
    957957 
     
    21692169 
    21702170    /** 
     2171     * Resolve the passed find by field name to the appropriate field name 
     2172     * regardless of whether the user passes a column name, field name, or a Doctrine_Inflector::classified() 
     2173     * version of their column name. It will be inflected with Doctrine_Inflector::tableize()  
     2174     * to get the column or field name 
     2175     * 
     2176     * @param string $name  
     2177     * @return string $fieldName 
     2178     */ 
     2179    protected function _resolveFindByFieldName($name) 
     2180    { 
     2181        $fieldName = Doctrine_Inflector::tableize($name); 
     2182        if ($this->hasColumn($name) || $this->hasField($name)) { 
     2183            return $this->getFieldName($this->getColumnName($name)); 
     2184        } else if ($this->hasColumn($fieldName) || $this->hasField($fieldName)) { 
     2185            return $this->getFieldName($this->getColumnName($fieldName)); 
     2186        } else { 
     2187            return false; 
     2188        } 
     2189    } 
     2190 
     2191    /** 
    21712192     * __call 
    21722193     * 
     
    21922213            } 
    21932214 
    2194             $fieldName = Doctrine_Inflector::tableize($by); 
     2215            $fieldName = $this->_resolveFindByFieldName($by); 
    21952216            $hydrationMode = isset($arguments[1]) ? $arguments[1]:null; 
    2196             if ($this->hasColumn($this->getColumnName($fieldName))) { 
     2217            if ($this->hasField($fieldName)) { 
    21972218                return $this->$method($fieldName, $arguments[0], $hydrationMode); 
    21982219            } else if ($this->hasRelation($by)) { 
  • branches/0.11/tests/run.php

    r4594 r4595  
    8282$tickets->addTestCase(new Doctrine_Ticket_1118_TestCase()); 
    8383$tickets->addTestCase(new Doctrine_Ticket_1123_TestCase()); 
     84$tickets->addTestCase(new Doctrine_Ticket_1124_TestCase()); 
    8485$tickets->addTestCase(new Doctrine_Ticket_1133_TestCase()); 
    8586$tickets->addTestCase(new Doctrine_Ticket_1175_TestCase());