public function Field::save

Overrides \Drupal\Core\Entity\Entity::save().

Return value

int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Throws

\Drupal\field\FieldException If the field definition is invalid.

\Drupal\Core\Entity\EntityStorageException In case of failures at the configuration storage level.

Overrides Entity::save

File

drupal/core/modules/field/lib/Drupal/field/Plugin/Core/Entity/Field.php, line 292
Contains \Drupal\field\Plugin\Core\Entity\Field.

Class

Field
Defines the Field entity.

Namespace

Drupal\field\Plugin\Core\Entity

Code

public function save() {

  // Clear the derived data about the field.
  unset($this->schema, $this->storageDetails);
  if ($this
    ->isNew()) {
    return $this
      ->saveNew();
  }
  else {
    return $this
      ->saveUpdated();
  }
}