Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BaseFieldDefinition.php

function BaseFieldDefinition::getCardinality

Overrides FieldStorageDefinitionInterface::getCardinality

1 call to BaseFieldDefinition::getCardinality()
BaseFieldDefinition::isMultiple in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
Returns whether the field can contain multiple items.

File

core/lib/Drupal/Core/Field/BaseFieldDefinition.php, line 258

Class

BaseFieldDefinition
A class for defining entity fields.

Namespace

Drupal\Core\Field

Code

public function getCardinality() {
    // @todo Allow to control this.
    return $this->definition['cardinality'] ?? 1;
}
RSS feed
Powered by Drupal