Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / system / tests / modules / entity_test / src / Entity / EntityTestMultiValueBasefield.php
1 <?php
2
3 namespace Drupal\entity_test\Entity;
4
5 use Drupal\Core\Entity\EntityTypeInterface;
6
7 /**
8  * Defines an entity type with a multivalue base field.
9  *
10  * @ContentEntityType(
11  *   id = "entity_test_multivalue_basefield",
12  *   label = @Translation("Entity Test with a multivalue base field"),
13  *   base_table = "entity_test_multivalue_basefield",
14  *   data_table = "entity_test_multivalue_basefield_field_data",
15  *   handlers = {
16  *     "views_data" = "Drupal\views\EntityViewsData",
17  *   },
18  *   entity_keys = {
19  *     "id" = "id",
20  *     "uuid" = "uuid",
21  *     "bundle" = "type",
22  *     "label" = "name",
23  *     "langcode" = "langcode",
24  *   }
25  * )
26  */
27 class EntityTestMultiValueBasefield extends EntityTest {
28
29   /**
30    * {@inheritdoc}
31    */
32   public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
33     $fields = parent::baseFieldDefinitions($entity_type);
34     $fields['name']->setCardinality(2);
35
36     return $fields;
37   }
38
39 }