You are here

public function ComputedStringItem::executeCode in Computed Field 8.2

Same name and namespace in other branches
  1. 3.x src/Plugin/Field/FieldType/ComputedStringItem.php \Drupal\computed_field\Plugin\Field\FieldType\ComputedStringItem::executeCode()

This function does the computation of the field value.

Return value

string The string.

Overrides ComputedFieldItemTrait::executeCode

File

src/Plugin/Field/FieldType/ComputedStringItem.php, line 101

Class

ComputedStringItem
Plugin implementation of the 'computed_string' field type.

Namespace

Drupal\computed_field\Plugin\Field\FieldType

Code

public function executeCode() {
  return mb_substr(parent::executeCode(), 0, $this
    ->getSettings()['max_length'] - 1);
}