- Filling values of context if vars exists within it
This commit is contained in:
parent
0a7b1cdc12
commit
1991122c32
|
@ -51,6 +51,8 @@ class FormContext implements FormContextInterface
|
|||
}
|
||||
}
|
||||
|
||||
$this->fillValues();
|
||||
|
||||
$this->files = $request->getUploadedFiles() ?: [];
|
||||
}
|
||||
|
||||
|
@ -142,4 +144,13 @@ class FormContext implements FormContextInterface
|
|||
{
|
||||
$this->messages[] = $message;
|
||||
}
|
||||
|
||||
protected function fillValues() : void
|
||||
{
|
||||
foreach($this->values as $property => $value) {
|
||||
if (property_exists($this, $property)) {
|
||||
$this->$property = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue