StringIdEntityTest.php

Same filename in other branches
  1. 8.9.x core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php
  2. 10 core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php
  3. 11.x core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php

Namespace

Drupal\migrate_entity_test\Entity

File

core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php

View source
<?php

namespace Drupal\migrate_entity_test\Entity;

use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;

/**
 * Defines a content entity type that has a string ID.
 *
 * @ContentEntityType(
 *   id = "migrate_string_id_entity_test",
 *   label = @Translation("String id entity test"),
 *   base_table = "migrate_entity_test_string_id",
 *   entity_keys = {
 *     "id" = "id",
 *   }
 * )
 */
class StringIdEntityTest extends ContentEntityBase {
    
    /**
     * {@inheritdoc}
     */
    public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
        return [
            'id' => BaseFieldDefinition::create('integer')->setSetting('size', 'big')
                ->setLabel('ID'),
            'version' => BaseFieldDefinition::create('string')->setLabel('Version'),
        ];
    }

}

Classes

Title Deprecated Summary
StringIdEntityTest Defines a content entity type that has a string ID.

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