You are here

private static function AutoIncrementingTestItem::getIncrementedFieldValue in Drupal 9

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

Gets an incremented field value.

Return value

int The incremented field value.

1 call to AutoIncrementingTestItem::getIncrementedFieldValue()
AutoIncrementingTestItem::preSave in core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/AutoIncrementingTestItem.php
Defines custom presave behavior for field values.

File

core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/AutoIncrementingTestItem.php, line 34

Class

AutoIncrementingTestItem
Defines the 'field_method_invocation_order_test' entity field type.

Namespace

Drupal\entity_test\Plugin\Field\FieldType

Code

private static function getIncrementedFieldValue() {
  static $cache = 0;
  return ++$cache;
}