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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.