class OgMembershipMetadataController in Organic groups 7
Same name and namespace in other branches
- 7.2 og.info.inc \OgMembershipMetadataController
Extend the defaults.
Hierarchy
Expanded class hierarchy of OgMembershipMetadataController
1 string reference to 'OgMembershipMetadataController'
- og_entity_info in ./
og.module - Implements hook_entity_info().
File
- includes/
og.info.inc, line 75 - Provides Entity metadata integration.
View source
class OgMembershipMetadataController extends EntityDefaultMetadataController {
public function entityPropertyInfo() {
$info = parent::entityPropertyInfo();
$properties =& $info[$this->type]['properties'];
// Initialize values
$properties = !empty($properties) ? $properties : array();
$properties += array(
'entity_type' => array(),
);
// Group ID is provided in the "group" property.
unset($properties['gid']);
$properties['group'] = array(
'label' => t("OG group"),
'type' => 'group',
'description' => t("The OG group associated with the OG membership."),
'required' => TRUE,
'getter callback' => 'entity_property_getter_method',
'schema field' => 'gid',
);
// Entity id is provided via the "entity" property.
unset($properties['etid']);
$properties['entity'] = array(
'label' => t('Entity'),
'type' => 'entity',
'description' => t('The entity that is a group content.'),
'getter callback' => 'og_entity_getter',
'setter callback' => 'og_entity_setter',
'setter permission' => 'administer group',
'required' => TRUE,
);
$properties['created']['type'] = 'date';
$properties['created'] += array(
'setter callback' => 'entity_property_verbatim_set',
);
$properties['state']['type'] = 'integer';
$properties['state'] += array(
'setter callback' => 'entity_property_verbatim_set',
'options list' => 'og_group_content_states',
'required' => TRUE,
);
$properties['entity_type'] += array(
'setter callback' => 'entity_property_verbatim_set',
);
$properties['type']['type'] = 'og_membership_type';
$properties['type'] += array(
'required' => TRUE,
'setter callback' => 'entity_property_verbatim_set',
);
return $info;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityDefaultMetadataController:: |
protected | property | ||
EntityDefaultMetadataController:: |
public static | function | A options list callback returning all bundles for an entity type. | |
EntityDefaultMetadataController:: |
protected | function | Return a set of properties for an entity based on the schema definition | |
EntityDefaultMetadataController:: |
public | function | ||
OgMembershipMetadataController:: |
public | function |
Overrides EntityDefaultMetadataController:: |