You are here

public function ComputedStringItem::executeCode in Computed Field 3.x

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

Return value

string The string.

Overrides ComputedFieldItemTrait::executeCode

File

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

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);
}