You are here

protected function FormBuilderElementBase::setProperty in Form Builder 7

Set the value of a property.

This method must update the $element for rendering as well as for later storage.

Parameters

string $property: Key of the property.

mixed $value: New value for the property.

1 call to FormBuilderElementBase::setProperty()
FormBuilderElementBase::configurationSubmit in ./form_builder.classes.inc
Submit handler for the configuration form.
1 method overrides FormBuilderElementBase::setProperty()
FormBuilderWebformElement::setProperty in modules/webform/form_builder_webform.classes.inc
Set the value of a property.

File

./form_builder.classes.inc, line 860

Class

FormBuilderElementBase

Code

protected function setProperty($property, $value) {

  // Remove empty properties entirely.
  if ($value === '' || is_null($value)) {
    unset($this->element['#' . $property]);
  }
  else {
    $this->element['#' . $property] = $value;
  }
}