entity_test.module

Same filename in other branches
  1. 9 core/modules/system/tests/modules/entity_test/entity_test.module
  2. 8.9.x core/modules/system/tests/modules/entity_test/entity_test.module
  3. 10 core/modules/system/tests/modules/entity_test/entity_test.module

File

core/modules/system/tests/modules/entity_test/entity_test.module

View source
<?php


/**
 * @file
 * Test module for the entity API providing several entity types for testing.
 */
declare (strict_types=1);
use Drupal\entity_test\EntityTestHelper;

/**
 * Creates a new bundle for entity_test entities.
 *
 * @param string $bundle
 *   The machine-readable name of the bundle.
 * @param string $text
 *   (optional) The human-readable name of the bundle. If none is provided, the
 *   machine name will be used.
 * @param string $entity_type
 *   (optional) The entity type for which the bundle is created. Defaults to
 *   'entity_test'.
 *
 * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use
 *   \Drupal\entity_test\EntityTestHelper::createBundle() instead.
 *
 * @see https://www.drupal.org/node/3497049
 */
function entity_test_create_bundle($bundle, $text = NULL, $entity_type = 'entity_test') {
    @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \\Drupal\\entity_test\\EntityTestHelper::createBundle() instead. See https://www.drupal.org/node/3497049', E_USER_DEPRECATED);
    EntityTestHelper::createBundle($bundle, $text, $entity_type);
}

/**
 * Deletes a bundle for entity_test entities.
 *
 * @param string $bundle
 *   The machine-readable name of the bundle to delete.
 * @param string $entity_type
 *   (optional) The entity type for which the bundle is deleted. Defaults to
 *   'entity_test'.
 *
 * @deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use
 *    \Drupal\entity_test\EntityTestHelper::deleteBundle() instead.
 *
 * @see https://www.drupal.org/node/3497049
 */
function entity_test_delete_bundle($bundle, $entity_type = 'entity_test') {
    @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \\Drupal\\entity_test\\EntityTestHelper::deleteBundle() instead. See https://www.drupal.org/node/3497049', E_USER_DEPRECATED);
    EntityTestHelper::deleteBundle($bundle, $entity_type);
}

Functions

Title Deprecated Summary
entity_test_create_bundle

in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal\entity_test\EntityTestHelper::createBundle() instead.

Creates a new bundle for entity_test entities.
entity_test_delete_bundle

in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal\entity_test\EntityTestHelper::deleteBundle() instead.

Deletes a bundle for entity_test entities.

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