You are here

public function FieldStorageConfig::setCardinality in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::setCardinality()

Sets the maximum number of items allowed for the field.

Parameters

int $cardinality: The cardinality value.

Return value

$this

Overrides FieldStorageConfigInterface::setCardinality

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 651

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

public function setCardinality($cardinality) {
  $this->cardinality = $cardinality;
  return $this;
}