You are here

public function RedhenOrgMetadataController::entityPropertyInfo in RedHen CRM 7

Overrides entityPropertyInfo().

Overrides EntityDefaultMetadataController::entityPropertyInfo

File

modules/redhen_org/lib/redhen_org.metadata.inc, line 18

Class

RedhenOrgMetadataController
Controls metadata for Redhen organizations

Code

public function entityPropertyInfo() {
  $info = parent::entityPropertyInfo();
  $properties =& $info[$this->type]['properties'];
  $properties['type'] = array(
    'label' => t('Type'),
    'description' => t('The type of organization.'),
    'type' => 'token',
    'setter callback' => 'entity_property_verbatim_set',
    'setter permission' => 'administer redhen orgs',
    'options list' => 'redhen_org_type_options_list',
    'required' => TRUE,
    'schema field' => 'type',
  );
  $properties['label'] = array(
    'label' => t('Organization Name'),
    'filter' => TRUE,
    'field_type' => 'textfield',
    'setter callback' => 'entity_property_verbatim_set',
    'required' => TRUE,
    'filter_operator' => 'CONTAINS',
  ) + $properties['label'];
  $properties['created'] = array(
    'label' => t("Created"),
    'description' => t("The date the organization was created."),
    'type' => 'date',
    'schema field' => 'created',
    'setter callback' => 'entity_property_verbatim_set',
  );
  $properties['updated'] = array(
    'label' => t("Updated"),
    'description' => t("The date the organization was updated."),
    'type' => 'date',
    'schema field' => 'updated',
    'setter callback' => 'entity_property_verbatim_set',
  );
  $properties['redhen_state'] = array_merge($properties['redhen_state'], array(
    'label' => t('State'),
    'filter' => TRUE,
    'field_type' => 'select',
    'options list' => 'redhen_state_options',
    'setter callback' => 'entity_property_verbatim_set',
    'required' => TRUE,
  ));

  // Entities.
  $properties['primary_contact'] = array(
    'label' => t("Primary contact"),
    'type' => 'redhen_contact',
    'description' => t("The primary contact for the organization."),
    'schema field' => 'primary_contact_id',
    'setter callback' => 'entity_property_verbatim_set',
  );
  $properties['author'] = array(
    'label' => t("Author"),
    'type' => 'user',
    'description' => t("The author of the organization record."),
    'schema field' => 'author_uid',
    'required' => TRUE,
  );
  return $info;
}