final public function PartyDefaultDataSet::getDataInfo in Party 8.2
Same name and namespace in other branches
- 7 includes/party.data.inc \PartyDefaultDataSet::getDataInfo()
Get information from the data set or entity definition.
Parameters
string $key: This is the information you want:
- 'type': the data set entity type.
- 'bundle': the data set entity bundle.
- 'id key': the entity id key.
- 'bundle key': the entity bundle key.
8 calls to PartyDefaultDataSet::getDataInfo()
- PartyDefaultDataSet::createEntity in includes/
party.data.inc - Create a new entity
- PartyDefaultDataSet::display in includes/
party.data.inc - Return the renderable array for one of our attached entities.
- PartyDefaultDataSet::getLabel in includes/
party.data.inc - Get the label of one of our attached entities.
- PartyDefaultDataSet::hook_party_delete in includes/
party.data.inc - Acts when a party is deleted.
- PartyDefaultDataSet::loadEntities in includes/
party.data.inc - Load the full entities.
File
- includes/
party.data.inc, line 138 - Provides the default class for managing party - Attached entity relationships.
Class
- PartyDefaultDataSet
- Class PartyDefaultDataSet
Code
public final function getDataInfo($key) {
// Get our info
$party_data_info = party_get_data_set_info($this->data_set);
$entity_info = entity_get_info($party_data_info['entity type']);
// Return the relevant information
switch ($key) {
// Data Set Info
case 'name':
return $this->data_set;
case 'path element':
return $party_data_info['path element'];
case 'label':
return $party_data_info['label'];
case 'entity type':
return $party_data_info['entity type'];
case 'entity bundle':
return $party_data_info['entity bundle'];
// entity Info
case 'id key':
return $entity_info['entity keys']['id'];
case 'bundle key':
return $entity_info['entity keys']['bundle'];
}
}