class OgMetadataController in Organic groups 7
Extend the defaults.
Hierarchy
- class \EntityDefaultMetadataController
- class \OgMetadataController
Expanded class hierarchy of OgMetadataController
1 string reference to 'OgMetadataController'
- og_entity_info in ./
og.module - Implements hook_entity_info().
File
- includes/
og.info.inc, line 11 - Provides Entity metadata integration.
View source
class OgMetadataController 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(),
);
$properties['entity'] = array(
'label' => t('Entity'),
'type' => 'entity',
'description' => t('The entity that is a group.'),
'getter callback' => 'og_entity_getter',
'setter permission' => 'administer group',
'required' => TRUE,
);
$properties['entity_type'] += array(
'required' => TRUE,
'options list' => 'og_get_all_group_entity',
);
$properties['created']['type'] = 'date';
$properties['state']['type'] = 'integer';
$properties['state'] += array(
'setter callback' => 'entity_property_verbatim_set',
'options list' => 'og_group_states',
'required' => TRUE,
);
// Custom properties.
$properties['members'] = array(
'label' => t("Members"),
'type' => 'list<user>',
'description' => t("A list of members of the group, including active, pending and blocked memberships."),
'getter callback' => 'og_get_properties',
);
$properties['manager'] = array(
'label' => t("Manager"),
'type' => 'user',
'description' => t("The user account of the group manager."),
'getter callback' => 'og_get_properties',
);
$properties['url'] = array(
'label' => t('URL'),
'type' => 'uri',
'description' => t("The URL to the entity that is a group."),
'getter callback' => 'og_get_properties',
);
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 | ||
OgMetadataController:: |
public | function |
Overrides EntityDefaultMetadataController:: |