Changeset 4299
- Timestamp:
- 04/30/08 03:26:33 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/manual/docs/en/component-overview.txt
r4159 r4299 194 194 +++ Refreshing records 195 195 196 Sometimes you may want to refresh your record with data from the database, use {{Doctrine_Record::refresh()}}. 196 Sometimes you may want to refresh your record with data from the database, use 197 {{Doctrine_Record::refresh()}}. 197 198 198 199 <code type="php"> … … 205 206 ++++ Refreshing relationships 206 207 207 The {{Doctrine_Record::refresh()}} method can also refresh record relationships, but you need to specify them on the query. 208 The {{Doctrine_Record::refresh($deep = false)}} method can also refresh the 209 already loaded record relationships, but you need to specify them on the 210 original query. 208 211 209 212 <code type="php"> … … 229 232 // get new user on group 230 233 $group->refresh(true); 234 </code> 235 236 You can also lazily refresh individual relationships or all defined relationships 237 of 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 231 244 </code> 232 245