Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. public function load($id, $field=null)
  2. {
  3. $this->_beforeLoad($id, $field);
  4. $this->_getResource()->load($this, $id, $field);
  5. $this->_afterLoad();
  6. $this->setOrigData();
  7. $this->_hasDataChanges = false;
  8. return $this;
  9. }
  10.  
  11. public function load($object, $entityId, $attributes = array())
  12. {
  13. Varien_Profiler::start('__EAV_LOAD_MODEL__');
  14. /**
  15. * Load object base row data
  16. */
  17. $select = $this->_getLoadRowSelect($object, $entityId);
  18. $row = $this->_getReadAdapter()->fetchRow($select);
  19.  
  20. ...
  21.  
  22. if (empty($attributes)) {
  23. $this->loadAllAttributes($object);
  24. } else {
  25. foreach ($attributes as $attrCode) {
  26. $this->getAttribute($attrCode);
  27. }
  28. }
  29.  
  30. $this->_loadModelAttributes($object);
  31.  
  32. ...
  33. }
  34.  
  35. $this->_getResource()->load($this, $id, $field); in Mage_Core_Model_Abstract
  36.  
  37. public function load(Mage_Core_Model_Abstract $object, $value, $field = null)
  38. {
  39. if (is_null($field)) {
  40. $field = $this->getIdFieldName();
  41. }
  42.  
  43. $read = $this->_getReadAdapter();
  44. if ($read && !is_null($value)) {
  45. $select = $this->_getLoadSelect($field, $value, $object);
  46. $data = $read->fetchRow($select);
  47.  
  48. if ($data) {
  49. $object->setData($data);
  50. }
  51. }
  52.  
  53. $this->unserializeFields($object);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement