Changeset 3123
- Timestamp:
- 04/15/08 08:09:12 (3 months ago)
- Files:
-
- trunk/Solar/Sql/Model/Record.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Solar/Sql/Model/Record.php
r3091 r3123 94 94 /** 95 95 * 96 * Tells whether or not __get() should lazy-load relateds.97 *98 * We need this so that when saving, we don't load every related record.99 *100 * @var bool101 *102 */103 protected $_lazy_load = true;104 105 /**106 *107 96 * If you call save() and an exception gets thrown, this stores that 108 97 * exception. … … 151 140 152 141 // do we need to load relationship data? 153 $load_related = $this->_lazy_load && 154 empty($this->_data[$key]) && 142 $load_related = empty($this->_data[$key]) && 155 143 ! empty($this->_model->related[$key]); 156 144 … … 379 367 } 380 368 369 // set placeholders for calculate cols 370 foreach ((array) $this->_model->calculate_cols as $col) { 371 if (! array_key_exists($col, $this->_data)) { 372 $this->_data[$col] = null; 373 } 374 } 375 381 376 // set all remaining values in the load 382 377 foreach ($load as $key => $val) { 383 378 $this->__set($key, $val); 384 379 } 385 386 380 } 387 381 … … 1039 1033 $filter->setChainLocaleObject($this->_model); 1040 1034 1041 // turn off lazy-loading while applying filters to make sure we don't 1042 // get recursive behavior 1043 $this->_lazy_load = false; 1035 // apply filters 1044 1036 $valid = $filter->applyChain($this); 1045 $this->_lazy_load = true;1046 1037 1047 1038 // retain invalids
