Skip to content
Snippets Groups Projects
Commit 9c3fca6d authored by Michael Grosse's avatar Michael Grosse
Browse files

refactor: Rename method to better convey its purpose

parent 45082b9e
No related branches found
No related tags found
No related merge requests found
......@@ -165,7 +165,7 @@ class DropdownElement extends InputElement {
$value_exists = false;
/** @var OptGroup $optGroup */
foreach (array_merge(array($this->options), $this->optGroups) as $optGroup) {
$value_exists = $optGroup->setValue($value) || $value_exists;
$value_exists = $optGroup->storeValue($value) || $value_exists;
if ($value_exists) {
$value = null;
}
......
......@@ -18,14 +18,14 @@ class OptGroup extends Element {
}
/**
* Set the element's value
* Store the given value so it can be used during rendering
*
* This is intended to be only called from within @see DropdownElement::val()
*
* @param string $value
* @return bool
* @return bool true if an option with the given value exists, false otherwise
*/
public function setValue($value) {
public function storeValue($value) {
$this->value = $value;
return isset($this->options[$value]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment