You are here

function party_subscription_settings_get_party in Party 8.2

Get the party from the party subscription settings entity

1 call to party_subscription_settings_get_party()
party_simplenews_party_subscription_settings_view in modules/party_simplenews/party_simplenews.module
Implements hook_party_subscription_settings_view()

File

modules/party_simplenews/party_subscription_settings.api.inc, line 86
Helper functions etc for the subscription settings

Code

function party_subscription_settings_get_party(PartySubscriptionSettings $party_subscription_settings) {
  $id = $party_subscription_settings->subscription_settings_id;
  $result = db_select('party_attached_entity', 'pae')
    ->fields('pae', array(
    'pid',
  ))
    ->condition('eid', $id, '=')
    ->condition('data_set', 'subscription_settings')
    ->execute()
    ->fetchCol();
  $party_id = reset($result);
  return party_load($party_id);
}