Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* DataObject.php - loadLazyFields($tableClass = null) */
- ....
- if ($columns) {
- $query = $dataQuery->query();
- $this->extend('augmentLoadLazyFields', $query, $dataQuery, $this);
- $this->extend('augmentSQL', $query, $dataQuery);
- $dataQuery->setQueriedColumns($columns);
- $newData = $dataQuery->execute()->record();
- // Load the data into record
- if($newData) {
- foreach($newData as $k => $v) {
- if (in_array($k, $columns)) {
- $this->record[$k] = $v;
- $this->original[$k] = $v;
- unset($this->record[$k . '_Lazy']);
- }
- }
- // No data means that the query returned nothing; assign 'null' to all the requested fields
- } else {
- foreach($columns as $k) {
- $this->record[$k] = null;
- $this->original[$k] = null;
- unset($this->record[$k . '_Lazy']);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement