You are here

public function FlexiformElementField::checkWidgetBehavior in Flexiform 7

Check widget behavior.

Parameters

array $instance: (optional) The instance array to check the widget behavior of. Defaults to the result of getInstance().

string $op: (optional) The $op to check the behavior of, either 'default value' (default) or 'multiple values'.

$behavior: (optional) The behavior.

See also

field_behaviors_widget()

4 calls to FlexiformElementField::checkWidgetBehavior()
FlexiformElementField::configureForm in includes/element/field.element.inc
Overrides FlexiformElement::configureForm().
FlexiformElementField::configureFormSubmit in includes/element/field.element.inc
Overrides FlexiformElement::configureFormSubmit().
FlexiformElementField::configureFormValidate in includes/element/field.element.inc
Overrides FlexiformElement::configureFormValidate().
FlexiformElementField::form in includes/element/field.element.inc
Return the form element for this FlexiformElement.

File

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

Class

FlexiformElementField
Class for Field API elements.

Code

public function checkWidgetBehavior($instance = array(), $op = 'default value', $behavior = FIELD_BEHAVIOR_DEFAULT) {
  if (empty($instance)) {
    $instance = $this
      ->getInstance();
  }
  return field_behaviors_widget($op, $instance) == $behavior;
}