- ⌂ cObject
- Methods
- Constructor
- add_variant()
- approve()
- as_array()
- can_add_variant()
- can_delete_variant()
- can_edit_variant()
- can_reorder_variant()
- clone()
- delete()
- edit_variant()
- enum()
- get_active_object()
- get_all_variants()
- get_attributes()
- get_dimensions()
- get_dimension_with()
- get_parent()
- get_primary_cpath()
- get_variant()
- Keywords()
- lock_object()
- reload_data()
- repo()
- revert()
- save()
- store()
- unlock_object()
- update_from_array()
- validate()
cObject::reload_data()
Update the PHP object in memory with the field values in the repository. It will update the PHP object with any changes that may have occurred to the object in the repository since it was last loaded. By default, any field values that have been modified in the PHP object since it was initially loaded will not be updated. If the optional parameter is TRUE, it will also revert any changes made to the PHP object in memory to the values in the repository. PHP objects do not automatically update as changes are made in the repository.
Prototype
void reload_data(boolean $overwrite_modified = FALSE)
Parameters
- overwrite_modified - If TRUE, fields modified since the object was first loaded will be updated to the value in the repository. Otherwise, modified values will remain, even if different than what is in the repository.
Return
Nothing is returned.
Example
$repo = \comand::repo();
$contact = $repo->get_first('FROM Contact LIMIT 1');
$contact->FirstName = 'Jim';
sleep(60);
// reload field values that may have changed in the repository
// if FirstName has changed in the repository, it will not be
// reloaded because it was modified above.
$contact->reload_data();