/** * Extracts an entity from the repository and the space and deletes an entity if * it's persisted. * * @param AnDomainEntityAbstract $entity The entity to extract */ public function extract($entity) { if ($entity->persisted()) { $entity->delete()->save(); } $this->_space->extractEntity($entity); }