You are here

function crm_core_activity_entity_property_info in CRM Core 7

Implements hook_entity_property_info().

File

modules/crm_core_activity/crm_core_activity.info.inc, line 11
Entity support.

Code

function crm_core_activity_entity_property_info() {
  $info = array();

  // Add meta-data about crm_activity properties.
  $properties =& $info['crm_core_activity']['properties'];
  $properties['activity_id'] = array(
    'label' => t('Activity ID'),
    'description' => t('The primary identifier for an activity.'),
    'type' => 'integer',
    'schema field' => 'activity_id',
  );
  $properties['type'] = array(
    'label' => t('Type'),
    'description' => t('The type (bundle) of the activity.'),
    'type' => 'token',
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'administer site configuration',
    'options list' => 'crm_core_activity_type_get_names',
    'required' => TRUE,
    'schema field' => 'type',
  );
  $properties['title'] = array(
    'label' => t('Title'),
    'description' => t('Title of the activity.'),
    'type' => 'text',
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'administer site configuration',
    'required' => TRUE,
    'schema field' => 'title',
  );
  $properties['uid'] = array(
    'label' => t('User'),
    'type' => 'integer',
    'description' => t('Relate a CRM Core Activity revision to the user who created the revision.'),
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'administer site configuration',
    'schema field' => 'uid',
  );
  $properties['created'] = array(
    'label' => t('Date created'),
    'description' => t('The date the activity was created.'),
    'type' => 'date',
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'dminister site configuration',
    'schema field' => 'created',
  );
  $properties['changed'] = array(
    'label' => t('Date updated'),
    'description' => t('The date the activity was last updated.'),
    'type' => 'date',
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'Administer site configuration',
    'schema field' => 'changed',
  );
  if (module_exists('uuid')) {
    $properties['uuid'] = array(
      'label' => t('UUID'),
      'type' => 'text',
      'description' => t('The universally unique ID.'),
      'schema field' => 'uuid',
    );
    $properties['vuuid'] = array(
      'label' => t('Revision UUID'),
      'type' => 'text',
      'description' => t("The revision's universally unique ID."),
      'schema field' => 'vuuid',
    );
  }

  // Metadata of Activity Type.
  $properties =& $info['crm_core_activity_type']['properties'];
  $properties['id'] = array(
    'label' => t('Activity Type ID'),
    'description' => t('Primary Key: Unique activity type ID.'),
    'type' => 'integer',
    'schema field' => 'id',
  );
  $properties['type'] = array(
    'label' => t('Type'),
    'description' => t('The machine-readable name of this type.'),
    'type' => 'token',
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'administer site configuration',
    'required' => TRUE,
    'schema field' => 'type',
  );
  $properties['label'] = array(
    'label' => t('Label'),
    'description' => t('The human-readable name of this type.'),
    'type' => 'text',
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'administer site configuration',
    'required' => TRUE,
    'schema field' => 'label',
  );
  $properties['description'] = array(
    'label' => t('Description'),
    'description' => t('A brief description of this type.'),
    'type' => 'text',
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'administer site configuration',
    'schema field' => 'description',
  );
  return $info;
}