You are here

public function BackgroundImage::save in Background Image 8

Same name and namespace in other branches
  1. 2.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::save()
  2. 2.0.x src/Entity/BackgroundImage.php \Drupal\background_image\Entity\BackgroundImage::save()

Saves an entity permanently.

When saving existing entities, the entity is assumed to be complete, partial updates of entities are not supported.

Return value

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

Throws

\Drupal\Core\Entity\EntityStorageException In case of failures an exception is thrown.

Overrides EntityBase::save

1 call to BackgroundImage::save()
BackgroundImage::associateEntity in src/Entity/BackgroundImage.php
Associates a specific entity with the background image.

File

src/Entity/BackgroundImage.php, line 697

Class

BackgroundImage
Defines the Background Image entity.

Namespace

Drupal\background_image\Entity

Code

public function save() {

  // Only save overridden settings.
  $this
    ->set('settings', $this
    ->getSettings()
    ->getOverridden());
  return parent::save();
}