|
@@ 183-185 (lines=3) @@
|
| 180 |
|
//if db model is instantiating |
| 181 |
|
if ($bydb) { |
| 182 |
|
//client code has indicated these field values are from the database |
| 183 |
|
foreach ($model_fields as $fieldName => $field) { |
| 184 |
|
$this->set_from_db($fieldName, isset($fieldValues[$fieldName]) ? $fieldValues[$fieldName] : null); |
| 185 |
|
} |
| 186 |
|
} else { |
| 187 |
|
//we're constructing a brand |
| 188 |
|
//new instance of the model object. Generally, this means we'll need to do more field validation |
|
@@ 189-191 (lines=3) @@
|
| 186 |
|
} else { |
| 187 |
|
//we're constructing a brand |
| 188 |
|
//new instance of the model object. Generally, this means we'll need to do more field validation |
| 189 |
|
foreach ($model_fields as $fieldName => $field) { |
| 190 |
|
$this->set($fieldName, isset($fieldValues[$fieldName]) ? $fieldValues[$fieldName] : null, true); |
| 191 |
|
} |
| 192 |
|
} |
| 193 |
|
//remember what values were passed to this constructor |
| 194 |
|
$this->_props_n_values_provided_in_constructor = $fieldValues; |