You are here

function synonyms_entity_property_info in Synonyms 7

Implements hook_entity_property_info().

File

./synonyms.module, line 133
Provide synonyms feature for Drupal entities.

Code

function synonyms_entity_property_info() {
  $info = array();
  foreach (entity_get_info() as $entity_type => $entity_info) {
    $entity_type = synonyms_entity_type_load($entity_type);
    if ($entity_type) {
      $info[$entity_type]['properties']['synonyms'] = array(
        'label' => t('Synonyms'),
        'description' => t('Synonyms of entity.'),
        'type' => 'list<text>',
        'getter callback' => 'synonyms_get_sanitized',
        'computed' => TRUE,
        'sanitized' => TRUE,
        'raw getter callback' => 'synonyms_get_raw',
        'translatable' => TRUE,
      );
    }
  }
  return $info;
}