Changeset 4466 for trunk/lib/Doctrine

Show
Ignore:
Timestamp:
06/02/08 16:00:50 (7 months ago)
Author:
guilhermeblanco
Message:

Fixes in ParserResult?, which was generating a bad table alias. Added more test cases. Commented new Event system call in EntityManager?. Fixes in RangeVariableDeclaration?.

Location:
trunk/lib/Doctrine
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Doctrine/EntityManager.php

    r4456 r4466  
    141141                $this, new Doctrine_ClassMetadata_CodeDriver()); 
    142142        $this->_unitOfWork = new Doctrine_Connection_UnitOfWork($conn); 
    143         $this->_eventManager = new Doctrine_EventManager(); 
     143        //$this->_eventManager = new Doctrine_EventManager(); 
    144144         
    145145        if ($name !== null) { 
  • trunk/lib/Doctrine/Query/ParserResult.php

    r4455 r4466  
    143143        $baseAlias = strtolower(preg_replace('/[^A-Z]/', '\\1', $componentName)); 
    144144 
     145        // We may have a situation where we have all chars are lowercased 
     146        if ( $baseAlias == '' ) { 
     147            // We simply grab the first 2 chars of component name 
     148            $baseAlias = substr($componentNam, 0, 2); 
     149        } 
     150 
    145151        $alias = $baseAlias; 
    146152 
  • trunk/lib/Doctrine/Query/Production/RangeVariableDeclaration.php

    r4451 r4466  
    145145        //echo "Identification Variable: " .$this->_identificationVariable . "\n"; 
    146146 
    147         $tableAlias = $parserResult->generateTableAlias($componentName); 
     147        $tableAlias = $parserResult->generateTableAlias($classMetadata->getClassName()); 
    148148        $parserResult->setQueryComponent($this->_identificationVariable, $queryComponent); 
    149149        $parserResult->setTableAlias($tableAlias, $this->_identificationVariable); 
     
    217217                    $parent = $path; 
    218218                } catch (Doctrine_Exception $e) { 
    219                     //echo "Tried to load class metadata from '".$relationName."'\n"; 
     219                    echo "Tried to load class metadata from '".$relationName."'\n"; 
    220220                    $this->_parser->semanticalError($e->getMessage()); 
    221221 
     
    229229        } 
    230230 
    231         $tableAlias = $parserResult->generateTableAlias($path); 
     231        $tableAlias = $parserResult->generateTableAlias($classMetadata->getClassName()); 
     232 
     233        //echo "Table alias: " . $tableAlias . "\n"; 
     234 
    232235        $parserResult->setQueryComponent($this->_identificationVariable, $queryComponent); 
    233236        $parserResult->setTableAlias($tableAlias, $this->_identificationVariable);