You are here

public function PartyDataBase::saveEntity in Party 8.2

Save an entity.

This method saves the entity at the position specified by delta. This allows for other modules to use different logic for saving their entities.

Parameters

int $delta: (optional) The delta of the entity to save. Defaults to 0.

Return value

EntityInterface The entity that has been saved.

1 call to PartyDataBase::saveEntity()
PartyDataBase::save in lib/Drupal/party/Plugin/PartyDataBase.php
Save the attached entities information

File

lib/Drupal/party/Plugin/PartyDataBase.php, line 364
Contains \Drupal\party\Plugin\PartyDataBase.

Class

PartyDataBase
Class PartyDataBase

Namespace

Drupal\party\Plugin

Code

public function saveEntity($delta = 0) {
  $entity = $this
    ->getEntity($delta);

  // If getting the entity failed, return false.
  if (!$entity) {
    return $entity;
  }
  drupal_container()
    ->get('plugin.manager.entity')
    ->getStorageController($this
    ->getDataInfo('entity type'))
    ->save($entity);
  return $entity;
}