You are here

protected function EntityShareEntityImport::saveEntity in Entity Share 7

Save the entity using uuid if needed.

Parameters

object $entity: Entity or sub entity to import.

Return value

object Imported Entity or sub entity.

1 call to EntityShareEntityImport::saveEntity()
EntityShareEntityImport::execute in includes/entity_share.entity.import.inc
Generate the import.

File

includes/entity_share.entity.import.inc, line 40
Class for handling Entity Import.

Class

EntityShareEntityImport
Manage general entity import.

Code

protected function saveEntity($entity = NULL) {
  if (!isset($entity)) {
    $entity = $this
      ->getEntity();
  }
  $this
    ->setLocalEntityIds($entity);

  // @TODO Handle exception thrown by entity_save() on failure.
  entity_save($entity->entity_type, $entity);
  return $entity;
}