You are here

class PartyUserDataSet in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_user/includes/party_user.data.inc \PartyUserDataSet

Controller class for CRM integration.

Hierarchy

Expanded class hierarchy of PartyUserDataSet

1 string reference to 'PartyUserDataSet'
party_user_party_data_set_info in modules/party_user/party_user.module
Implements hook_party_data_set_info()

File

modules/party_user/includes/party_user.data.inc, line 10
Provides the class for managing user data sets.

View source
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();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PartyDefaultDataSet::$data_set protected property var string $data_set The data set name (array key in hook_data_set_info)
PartyDefaultDataSet::$entities protected property var array $entities An array of attatched entities, keyed by delta. This can contain a mix of stub entities (with the is_stub property set to TRUE), fully loaded entities and unsaved entities (with the is_new property set to TRUE).
PartyDefaultDataSet::$party protected property var party $party The party object we're connected to.
PartyDefaultDataSet::$saving private property var $saving A flag to indicate whether we're currently doing a controller save to prevent concurrency issues.
PartyDefaultDataSet::attachEntity final public function Attach an entity to the party
PartyDefaultDataSet::createEntity public function Create a new entity
PartyDefaultDataSet::detachEntity final public function Detach an entity
PartyDefaultDataSet::detachEntityByDelta final public function Detatch an entity by delta
PartyDefaultDataSet::display public function Return the renderable array for one of our attached entities.
PartyDefaultDataSet::getActions public function Get actions for the attached entity. Check party access in each case.
PartyDefaultDataSet::getDataInfo final public function Get information from the data set or entity definition.
PartyDefaultDataSet::getEntities public function Get all attached entities
PartyDefaultDataSet::getEntity public function Get a particular attached entity
PartyDefaultDataSet::getEntityDelta public function Get the delta from an entity object.
PartyDefaultDataSet::getEntityIds public function Get entity ids/deltas
PartyDefaultDataSet::getParty public function Method to return the party object
PartyDefaultDataSet::hook_entity_info_alter static function Alters entity info for entities requesting CRM integration.
PartyDefaultDataSet::loadEntities public function Load the full entities.
PartyDefaultDataSet::postAttach protected function Overload any post attach logic
PartyDefaultDataSet::postDetach protected function Overload any post detach logic
PartyDefaultDataSet::postSave protected function Overload any post save logic
PartyDefaultDataSet::preAttach protected function Overload any pre attach logic
PartyDefaultDataSet::preDetach protected function Overload any pre detach logic
PartyDefaultDataSet::preSave protected function Overload any pre save logic
PartyDefaultDataSet::reorderEntities final public function Re-order attached entities
PartyDefaultDataSet::save final public function Save the attached entities information
PartyDefaultDataSet::saveEntity public function Save an entity.
PartyDefaultDataSet::shiftEntity final public function Shift a particular entity in the order
PartyDefaultDataSet::__construct public function Constructor
PartyUserDataSet::getLabel public function Get the user label. Overrides PartyDefaultDataSet::getLabel
PartyUserDataSet::hook_party_delete public function Act on party delete. Overrides PartyDefaultDataSet::hook_party_delete