| @@ 550-554 (lines=5) @@ | ||
| 547 | */ |
|
| 548 | public function setDbData(array $data) |
|
| 549 | { |
|
| 550 | foreach (array_keys(static::$dbProperties) as $propertyName) { |
|
| 551 | if (array_key_exists($propertyName, $data)) { |
|
| 552 | $this->setDbValue($propertyName, $data[$propertyName], true); |
|
| 553 | } |
|
| 554 | } |
|
| 555 | } |
|
| 556 | ||
| 557 | /** |
|
| @@ 574-579 (lines=6) @@ | ||
| 571 | } |
|
| 572 | // If there are more row data than properties, use properties as starting point |
|
| 573 | } else { |
|
| 574 | foreach (array_keys(static::$dbProperties) as $propertyName) { |
|
| 575 | $fieldName = static::getDbFieldName($propertyName); |
|
| 576 | if (array_key_exists($fieldName, $rowData)) { |
|
| 577 | $this->setDbValue($propertyName, $rowData[$fieldName], false); |
|
| 578 | } |
|
| 579 | } |
|
| 580 | } |
|
| 581 | ||
| 582 | $this->updatePrimaryDbValueFromDbData(); |
|