You are here

public function ComputedFieldItemTrait::preSave in Computed Field 8.2

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

File

src/Plugin/Field/FieldType/ComputedFieldItemTrait.php, line 28

Class

ComputedFieldItemTrait
Common methods for Computed Field FieldType plugins.

Namespace

Drupal\computed_field\Plugin\Field\FieldType

Code

public function preSave() {
  $value = $this
    ->executeCode();
  $this
    ->setValue($value);
}