function FieldStorageDefinitionInterface::getCardinality

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php \Drupal\Core\Field\FieldStorageDefinitionInterface::getCardinality()
  2. 10 core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php \Drupal\Core\Field\FieldStorageDefinitionInterface::getCardinality()
  3. 11.x core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php \Drupal\Core\Field\FieldStorageDefinitionInterface::getCardinality()

Returns the maximum number of items allowed for the field.

Possible values are positive integers or FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED.

Return value

int The field cardinality.

2 methods override FieldStorageDefinitionInterface::getCardinality()
BaseFieldDefinition::getCardinality in core/lib/Drupal/Core/Field/BaseFieldDefinition.php
Returns the maximum number of items allowed for the field.
FieldStorageConfig::getCardinality in core/modules/field/src/Entity/FieldStorageConfig.php
Returns the maximum number of items allowed for the field.

File

core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php, line 175

Class

FieldStorageDefinitionInterface
Defines an interface for entity field storage definitions.

Namespace

Drupal\Core\Field

Code

public function getCardinality();

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