function FieldConfig::postCreate

Same name in other branches
  1. 9 core/modules/field/src/Entity/FieldConfig.php \Drupal\field\Entity\FieldConfig::postCreate()
  2. 8.9.x core/modules/field/src/Entity/FieldConfig.php \Drupal\field\Entity\FieldConfig::postCreate()
  3. 10 core/modules/field/src/Entity/FieldConfig.php \Drupal\field\Entity\FieldConfig::postCreate()

Overrides FieldConfigBase::postCreate

File

core/modules/field/src/Entity/FieldConfig.php, line 141

Class

FieldConfig
Defines the Field entity.

Namespace

Drupal\field\Entity

Code

public function postCreate(EntityStorageInterface $storage) {
    parent::postCreate($storage);
    // Validate that we have a valid storage for this field. This throws an
    // exception if the storage is invalid.
    $this->getFieldStorageDefinition();
    // 'Label' defaults to the field name (mostly useful for fields created in
    // tests).
    if (empty($this->label)) {
        $this->label = $this->getName();
    }
}

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