| @@ 527-531 (lines=5) @@ | ||
| 524 | */ |
|
| 525 | public function setDbData(array $data) |
|
| 526 | { |
|
| 527 | foreach (array_keys(static::$dbProperties) as $propertyName) { |
|
| 528 | if (array_key_exists($propertyName, $data)) { |
|
| 529 | $this->setDbValue($propertyName, $data[$propertyName], true); |
|
| 530 | } |
|
| 531 | } |
|
| 532 | } |
|
| 533 | ||
| 534 | /** |
|
| @@ 551-556 (lines=6) @@ | ||
| 548 | } |
|
| 549 | // If there are more row data than properties, use properties as starting point |
|
| 550 | } else { |
|
| 551 | foreach (array_keys(static::$dbProperties) as $propertyName) { |
|
| 552 | $fieldName = static::getDbFieldName($propertyName); |
|
| 553 | if (array_key_exists($fieldName, $rowData)) { |
|
| 554 | $this->setDbValue($propertyName, $rowData[$fieldName], false); |
|
| 555 | } |
|
| 556 | } |
|
| 557 | } |
|
| 558 | ||
| 559 | $this->updatePrimaryDbValueFromDbData(); |
|