You are here

public function FlexiformElementField::__construct in Flexiform 7

Overrides FlexiformElement::__construct().

Overrides FlexiformElement::__construct

File

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

Class

FlexiformElementField
Class for Field API elements.

Code

public function __construct($flexiform, $settings, $element_namespace = '') {
  parent::__construct($flexiform, $settings, $element_namespace);
  $this->field_name = $this->element_info['field_name'];

  // Build the fake instance for this form (incase the widget has changed -
  // we would normally have to be careful of default_value but that doesn't
  // figure here, so we should be fine.
  $this->instance = !empty($settings['instance']) ? $settings['instance'] : array();
  $this->field = !empty($settings['field']) ? $settings['field'] : array();

  // Get the initial weight.
  $instance = $this
    ->getInstance();
  $this->weight = isset($settings['weight']) ? $settings['weight'] : $instance['widget']['weight'];
}