DirectorObjectForm: provide setSentValue helper

This commit is contained in:
Thomas Gelf 2016-05-13 14:13:48 +02:00
parent 5c2f638593
commit 728c0745ae
1 changed files with 12 additions and 0 deletions

View File

@ -565,6 +565,18 @@ abstract class DirectorObjectForm extends QuickForm
return $el;
}
protected function setSentValue($name, $value)
{
if ($this->hasBeenSent()) {
$request = $this->getRequest();
if ($value !== null && $request->isPost() && $request->getPost($name) !== null) {
$request->setPost($name, $value);
}
}
return $this->setElementValue($name, $value);
}
protected function setElementValue($name, $value = null, $inherited = null, $inheritedFrom = null)
{
$el = $this->getElement($name);