public function FieldInstance::offsetSet

Implements ArrayAccess::offsetSet().

File

drupal/core/modules/field/lib/Drupal/field/FieldInstance.php, line 176
Definition of Drupal\field\FieldInstance.

Class

FieldInstance
Class for field instance objects.

Namespace

Drupal\field

Code

public function offsetSet($offset, $value) {
  if (!isset($offset)) {

    // Do nothing; $array[] syntax is not supported by this temporary wrapper.
    return;
  }
  $this->definition[$offset] = $value;

  // If the widget or formatter properties changed, the corrsponding plugins
  // need to be re-instanciated.
  if ($offset == 'widget') {
    unset($this->widget);
  }
  if ($offset == 'display') {
    unset($this->formatters);
  }
}