Changeset 4299

Show
Ignore:
Timestamp:
04/30/08 03:26:33 (14 months ago)
Author:
jwage
Message:

fixes #634

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/manual/docs/en/component-overview.txt

    r4159 r4299  
    194194+++ Refreshing records 
    195195 
    196 Sometimes you may want to refresh your record with data from the database, use {{Doctrine_Record::refresh()}}. 
     196Sometimes you may want to refresh your record with data from the database, use 
     197 {{Doctrine_Record::refresh()}}. 
    197198 
    198199<code type="php"> 
     
    205206++++ Refreshing relationships 
    206207 
    207 The {{Doctrine_Record::refresh()}} method can also refresh record relationships, but you need to specify them on the query. 
     208The {{Doctrine_Record::refresh($deep = false)}} method can also refresh the  
     209already loaded record relationships, but you need to specify them on the 
     210original query. 
    208211 
    209212<code type="php"> 
     
    229232// get new user on group 
    230233$group->refresh(true); 
     234</code> 
     235 
     236You can also lazily refresh individual relationships or all defined relationships  
     237of a model using  {{Doctrine_Record::refreshRelated($name = null)}}. 
     238 
     239<code type="php"> 
     240$user = Doctrine::getTable('User')->findOneByName('jon'); 
     241$user->refreshRelated(); // Will lazily load all defined relationships 
     242 
     243$user->refreshRelated('Phonenumber'); // Will lazily load the Phonenumber relationship 
    231244</code> 
    232245