mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
support value= attribute for model optiondata, for https://github.com/opnsense/core/issues/1832
This commit is contained in:
parent
93c40a5e93
commit
c7c1c55c8e
@ -96,7 +96,13 @@ abstract class BaseModel
|
||||
} else {
|
||||
$result = array();
|
||||
foreach ($xmlNode->children() as $childNode) {
|
||||
$result[$childNode->getName()] = $this->parseOptionData($childNode);
|
||||
// item keys can be overwritten using value attributes
|
||||
if (empty($childNode->attributes()['value'])) {
|
||||
$itemKey = (string)$childNode->getName();
|
||||
} else {
|
||||
$itemKey = (string)$childNode->attributes()['value'];
|
||||
}
|
||||
$result[$itemKey] = $this->parseOptionData($childNode);
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user