3 namespace Drupal\inline_entity_form_test\Entity;
5 use Drupal\Core\Entity\ContentEntityBase;
6 use Drupal\Core\Entity\EntityTypeInterface;
7 use Drupal\Core\Field\BaseFieldDefinition;
10 * Defines a test entity class without bundles.
13 * id = "entity_test__without_bundle",
14 * label = @Translation("Test entity without bundle"),
15 * base_table = "entity_test__without_bundle",
16 * admin_permission = "administer entity_test__without_bundle content",
21 * "langcode" = "langcode",
24 * "route_provider" = {
25 * "html" = "Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider",
29 * "canonical" = "/entity_test__without_bundle/{entity_test__without_bundle}",
33 class EntityTestWithoutBundle extends ContentEntityBase {
38 public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
39 $fields = parent::baseFieldDefinitions($entity_type);
41 $fields['name'] = BaseFieldDefinition::create('string')
43 ->setDescription(t('The name of the test entity.'))
44 ->setTranslatable(TRUE)
45 ->setSetting('max_length', 32)
46 ->setDisplayOptions('view', [
51 ->setDisplayOptions('form', [
52 'type' => 'string_textfield',