You are here

protected function FieldTestItem::mustResave in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/FieldTestItem.php \Drupal\entity_test\Plugin\Field\FieldType\FieldTestItem::mustResave()
  2. 9 core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/FieldTestItem.php \Drupal\entity_test\Plugin\Field\FieldType\FieldTestItem::mustResave()

Checks whether the field item value should be resaved.

Return value

bool TRUE if the item should be resaved, FALSE otherwise.

2 calls to FieldTestItem::mustResave()
FieldTestItem::postSave in core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/FieldTestItem.php
Defines custom post-save behavior for field values.
FieldTestItem::preSave in core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/FieldTestItem.php
Defines custom presave behavior for field values.

File

core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/FieldTestItem.php, line 108

Class

FieldTestItem
Defines the 'field_test' entity field type.

Namespace

Drupal\entity_test\Plugin\Field\FieldType

Code

protected function mustResave() {
  return $this
    ->getValue()['value'] == 'resave';
}