You are here

public function CivicrmOptions::hasMultipleValues in Webform CiviCRM Integration 8.5

Checks if the element value has multiple values.

Parameters

array $element: An element.

Return value

bool TRUE if the element value has multiple values.

Overrides WebformElementBase::hasMultipleValues

1 call to CivicrmOptions::hasMultipleValues()
CivicrmOptions::getRelatedTypes in src/Plugin/WebformElement/CivicrmOptions.php
Get related element types.

File

src/Plugin/WebformElement/CivicrmOptions.php, line 241

Class

CivicrmOptions
Provides a 'civicrm_options' element.

Namespace

Drupal\webform_civicrm\Plugin\WebformElement

Code

public function hasMultipleValues(array $element) {
  if (!empty($element['#extra']['multiple']) || empty($element['#civicrm_live_options']) && !empty($element['#options']) && count($element['#options']) === 1) {
    return TRUE;
  }
  return FALSE;
}