| @@ 404-408 (lines=5) @@ | ||
| 401 | */ |
|
| 402 | public function setDbData(array $data) |
|
| 403 | { |
|
| 404 | foreach (array_keys(static::$dbProperties) as $propertyName) { |
|
| 405 | if (array_key_exists($propertyName, $data)) { |
|
| 406 | $this->setDbValue($propertyName, $data[$propertyName], true); |
|
| 407 | } |
|
| 408 | } |
|
| 409 | } |
|
| 410 | ||
| 411 | /** |
|
| @@ 428-433 (lines=6) @@ | ||
| 425 | } |
|
| 426 | // If there are more row data than properties, use properties as starting point |
|
| 427 | } else { |
|
| 428 | foreach (array_keys(static::$dbProperties) as $propertyName) { |
|
| 429 | $fieldName = static::getDbFieldName($propertyName); |
|
| 430 | if (array_key_exists($fieldName, $rowData)) { |
|
| 431 | $this->setDbValue($propertyName, $rowData[$fieldName], false); |
|
| 432 | } |
|
| 433 | } |
|
| 434 | } |
|
| 435 | } |
|
| 436 | ||