You are here

public function HideIfString::access in Field Formatter Condition 8

Access control function.

Parameters

array $build: The current build array.

string $field: The current field name.

array $settings: The current settings array.

Overrides FieldFormatterConditionBase::access

File

src/Plugin/Field/FieldFormatter/Condition/HideIfString.php, line 52

Class

HideIfString
The plugin for check empty fields.

Namespace

Drupal\fico\Plugin\Field\FieldFormatter\Condition

Code

public function access(&$build, $field, $settings) {
  $found = fico_string_search($build, $field, $settings);
  if ($found == TRUE) {
    $build[$field]['#access'] = FALSE;
  }
}