You are here

function entity_legal_entity_info_alter in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.module \entity_legal_entity_info_alter()

Implements hook_entity_info_alter().

File

./entity_legal.module, line 97
Entity Legal module.

Code

function entity_legal_entity_info_alter(&$entity_info) {
  foreach (entity_legal_get_types() as $type => $info) {
    $entity_info[ENTITY_LEGAL_DOCUMENT_VERSION_ENTITY_NAME]['bundles'][$type] = array(
      'label' => $info->label,
    );
  }
  $entity_legal_document =& $entity_info[ENTITY_LEGAL_DOCUMENT_VERSION_ENTITY_NAME]['properties'];
  $entity_legal_document['author'] = array(
    'label' => t('Author'),
    'type' => 'user',
    'description' => t("The author of the document."),
    'getter callback' => 'entity_legal_get_properties',
    'required' => TRUE,
    'schema field' => 'uid',
  );
  $entity_legal_document['created'] = array(
    'label' => t('Created'),
    'type' => 'date',
    'description' => t("The date the document was created."),
    'required' => TRUE,
    'schema field' => 'created',
  );
  $entity_legal_document['updated'] = array(
    'label' => t('Updated'),
    'type' => 'date',
    'description' => t("The date the document was updated."),
    'required' => TRUE,
    'schema field' => 'updated',
  );
  $entity_legal_document_acceptance =& $entity_info[ENTITY_LEGAL_DOCUMENT_ACCEPTANCE_ENTITY_NAME]['properties'];
  $entity_legal_document_acceptance['author'] = array(
    'label' => t('Author'),
    'type' => 'user',
    'description' => t('The author of the acceptance.'),
    'getter callback' => 'entity_legal_get_properties',
    'required' => TRUE,
    'schema field' => 'uid',
  );
  $entity_legal_document_acceptance['acceptance_date'] = array(
    'label' => t('Date accepted'),
    'type' => 'date',
    'schema field' => 'acceptance_date',
    'description' => t("The date the document was accepted."),
  );
}