You are here

public function OgMetadataController::entityPropertyInfo in Organic groups 7

Overrides EntityDefaultMetadataController::entityPropertyInfo

File

includes/og.info.inc, line 13
Provides Entity metadata integration.

Class

OgMetadataController
Extend the defaults.

Code

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;
}