root/trunk/application/models/ignitedrecord/record.php
| 99 | 110 | ||
|---|---|---|---|
130 | function __wakeup() | 130 | function __wakeup() |
131 | { | 131 | { |
132 | $CI =& get_instance(); | 132 | $CI =& get_instance(); |
133 | $name = IR_RelProperty::_get_modelname($this->__table); | ||
134 | 133 | ||
135 | if( ! isset($CI->$name)) | 134 | if($model = IR_base::get_model($this->__table)) |
136 | { | 135 | { |
137 | log_message('error','The model linked to the table "'. | 136 | $this->__instance =& $model; |
138 | $this->__table.'" was not found, resulting in a read only object.'); | ||
139 | } | 137 | } |
140 | else | 138 | else |
141 | { | 139 | { |
142 | $this->__instance =& $CI->$name; | 140 | log_message('error','The model linked to the table "'. |
141 | $this->__table.'" was not found, resulting in a read only object.'); | ||
143 | } | 142 | } |
144 | } | 143 | } |
145 | 144 | ||
... | ... | ||
162 | * | 161 | * |
163 | * To prevent from accidentally editing the uid of the row. | 162 | * To prevent from accidentally editing the uid of the row. |
164 | * | 163 | * |
164 | * @deprecated (use the property instead) | ||
165 | * @since 0.1.1 | 165 | * @since 0.1.1 |
166 | * @return the value of the id column(s) (false if not in db) | 166 | * @return the value of the id column(s) (false if not in db) |
167 | */ | 167 | */ |
... | ... | ||
178 | * @since 0.2.0 | 178 | * @since 0.2.0 |
179 | * @access public | 179 | * @access public |
180 | * @param $data The data to be loaded, with column name as key, data as value | 180 | * @param $data The data to be loaded, with column name as key, data as value |
181 | * | ||
182 | * @return void | 181 | * @return void |
183 | */ | 182 | */ |
184 | function load_data($data = array()) | 183 | function load_data($data = array()) |
Download diff