You are here

public static function SuggestionHelper::optionBits in Autocomplete Search Suggestions 8

Same name and namespace in other branches
  1. 8.2 src/SuggestionHelper.php \Drupal\suggestion\SuggestionHelper::optionBits()
  2. 3.0.x src/SuggestionHelper.php \Drupal\suggestion\SuggestionHelper::optionBits()

Convert an array of submitted form options to a bitmap.

Parameters

array $bits: An array of form options.

Return value

int The option values bitwise OR.

1 call to SuggestionHelper::optionBits()
SuggestionSearchForm::submitUpdateForm in src/Form/SuggestionSearchForm.php
Ngram update submission function.

File

src/SuggestionHelper.php, line 293

Class

SuggestionHelper
Provides helper methods for suggestions.

Namespace

Drupal\suggestion

Code

public static function optionBits(array $bits = []) {
  $src = 0;
  foreach ($bits as $bit) {
    $src |= intval($bit);
  }
  return $src;
}