public function FieldInstance::save

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

Return value

Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Throws

\Drupal\field\FieldException If the field instance 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/FieldInstance.php, line 326
Contains \Drupal\field\Plugin\Core\Entity\FieldInstance.

Class

FieldInstance
Defines the Field instance entity.

Namespace

Drupal\field\Plugin\Core\Entity

Code

public function save() {
  if ($this
    ->isNew()) {
    return $this
      ->saveNew();
  }
  else {
    return $this
      ->saveUpdated();
  }
}