You are here

public function FlexiformElementField::getInstance in Flexiform 7

Get the instance array.

At this point we merge the instance settings for the form into the normal field instance settings.

Overrides FlexiformElementFieldAPIInterface::getInstance

12 calls to FlexiformElementField::getInstance()
FlexiformElementField::checkWidgetBehavior in includes/element/field.element.inc
Check widget behavior.
FlexiformElementField::configureForm in includes/element/field.element.inc
Overrides FlexiformElement::configureForm().
FlexiformElementField::configureFormSubmit in includes/element/field.element.inc
Overrides FlexiformElement::configureFormSubmit().
FlexiformElementField::fieldInvoke in includes/element/field.element.inc
Invoke field hooks on a specific field.
FlexiformElementField::form in includes/element/field.element.inc
Return the form element for this FlexiformElement.

... See full list

File

includes/element/field.element.inc, line 98
Contains FlexiformElementField class.

Class

FlexiformElementField
Class for Field API elements.

Code

public function getInstance() {
  if (empty($this->full_instance)) {
    $field_instance = field_info_instance($this->entity_type, $this->field_name, $this->bundle);
    $this->full_instance = array_replace_recursive($field_instance, $this->instance);

    // Default value might be a numerically indexed array, so we'll overwrite
    if (isset($this->instance['default_value'])) {
      $this->full_instance['default_value'] = $this->instance['default_value'];
    }

    // Here we check if a default value function is used.
    if (isset($this->instance['use_default_value_function'])) {
      if (empty($this->instance['use_default_value_function'])) {
        unset($this->full_instance['default_value_function']);
      }
      else {
        unset($this->full_instance['default_value']);
      }
    }
  }
  return $this->full_instance;
}