You are here

party_user.data.inc in Party 8.2

Same filename and directory in other branches
  1. 7 modules/party_user/includes/party_user.data.inc

Provides the class for managing user data sets.

File

modules/party_user/includes/party_user.data.inc
View source
<?php

/**
 * @file
 * Provides the class for managing user data sets.
 */

/**
 * Controller class for CRM integration.
 */
class PartyUserDataSet extends PartyDefaultDataSet {

  /**
   * Get the user label.
   */
  public function getLabel($delta) {
    $entity = $this
      ->getEntity($delta);
    return format_username($entity);
  }

  /**
   * Act on party delete.
   */
  public function hook_party_delete() {
    foreach ($this
      ->getEntities() as $user) {
      $this
        ->detachEntity($user);
      $method = variable_get('party_user_party_delete_action', 'disallow');
      if ($method != 'disallow') {
        user_cancel(array(), $user->uid, $method);
      }
    }
    $this
      ->save();
  }

}

Classes

Namesort descending Description
PartyUserDataSet Controller class for CRM integration.