class DependencyFieldItem

Same name and namespace in other branches
  1. 9 core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php \Drupal\Tests\field\Unit\DependencyFieldItem
  2. 8.9.x core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php \Drupal\Tests\field\Unit\DependencyFieldItem
  3. 10 core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php \Drupal\Tests\field\Unit\DependencyFieldItem

A test class.

Hierarchy

Expanded class hierarchy of DependencyFieldItem

See also

\Drupal\Tests\field\Unit\FieldConfigEntityUnitTest::testCalculateDependencies()

File

core/modules/field/tests/src/Unit/FieldConfigEntityUnitTest.php, line 304

Namespace

Drupal\Tests\field\Unit
View source
class DependencyFieldItem {
  
  /**
   * Gets the dependencies for this field item.
   */
  public static function calculateDependencies(FieldDefinitionInterface $definition) {
    return [
      'module' => [
        'test_module3',
      ],
    ];
  }
  
  /**
   * Informs the entity that entities it depends on will be deleted.
   */
  public static function onDependencyRemoval($field_config, $dependencies) {
  }

}

Members

Title Sort descending Modifiers Object type Summary
DependencyFieldItem::calculateDependencies public static function Gets the dependencies for this field item.
DependencyFieldItem::onDependencyRemoval public static function Informs the entity that entities it depends on will be deleted.

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