You are here

function party_user_party_property_get in Party 7

Party property getter for the user entity.

Make sure the party_attaching_party property is set before trying to use it.

See also

entity_property_verbatim_get

1 string reference to 'party_user_party_property_get'
party_user_entity_property_info_alter in modules/party_user/party_user.info.inc
Implements hook_entity_property_info_alter().

File

modules/party_user/party_user.module, line 416
Support for linking users to parties

Code

function party_user_party_property_get($data, array $options, $name, $type, $info) {
  if (empty($data->party_attaching_party)) {
    $data->party_attaching_party = db_select('party_attached_entity', 'pae')
      ->fields('pae', array(
      'pid',
    ))
      ->condition('eid', $data->uid)
      ->condition('entity_type', 'user')
      ->execute()
      ->fetchField();
  }
  return $data->party_attaching_party;
}