Changeset 4468

Show
Ignore:
Timestamp:
06/02/08 21:46:51 (13 months ago)
Author:
hansbrix
Message:

quick fix to an un-aliased query, to prevent confusion as raised by a beginner in #doctrine

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/manual/docs/en/working-with-objects.txt

    r4159 r4468  
    230230<code type="php"> 
    231231$user = Doctrine_Query::create() 
    232     ->from('User') 
    233     ->leftJoin('Groups') 
    234     ->where('id = ?') 
    235     ->fetchOne(array(1)); 
     232    ->select('u.*, g.*') 
     233    ->from('User u') 
     234    ->leftJoin('u.Groups g') 
     235    ->where('id = ?', 1) 
     236    ->fetchOne(); 
    236237 
    237238// Display this object on a cool javascript form that allows you to: 
     
    245246 
    246247$user = Doctrine_Query::create() 
    247     ->from('User') 
    248     ->leftJoin('Groups') 
    249     ->where('id = ?') 
    250     ->fetchOne(array(1)); 
     248    ->select('u.*, g.*') 
     249    ->from('User u') 
     250    ->leftJoin('u.Groups g') 
     251    ->where('id = ?', 1) 
     252    ->fetchOne(); 
    251253 
    252254// sanitize the form input an get the data