You are here

final public function PartyDataBase::detachEntity in Party 8.2

Detach an entity

This is a helper method to detach an entity when you have it's object. This method cannot be overloaded and any extensions of this class can make use of PartyDefaultDataSet::preAttach() and PartyDefaultDataSet::postAttach() to perform any additional logic required.

Parameters

int $delta: The delta of the entity to detach

Return value

$this

See also

PartyDefaultDataSet::detchEntityByDelta()

PartyDefaultDataSet::preDetach()

PartyDefaultDataSet::postDetach()

File

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

Class

PartyDataBase
Class PartyDataBase

Namespace

Drupal\party\Plugin

Code

public final function detachEntity($entity) {

  // Figure out our delta
  $delta = $this
    ->getEntityDelta($entity);

  // Pass this onto the detachEntityByDelta method to actually detach
  $this
    ->detachEntityByDelta($delta);
  return $this;
}