You are here

function _tmgmt_override_property_description in Translation Management Tool 7

Populates all entity property descriptions based on the schema definition.

Parameters

$info: Entity propety info array.

Return value

The altered entity properties array.

4 calls to _tmgmt_override_property_description()
TMGMTJobItemMetadataController::entityPropertyInfo in includes/tmgmt.info.inc
TMGMTJobMetadataController::entityPropertyInfo in includes/tmgmt.info.inc
TMGMTMessageMetadataController::entityPropertyInfo in includes/tmgmt.info.inc
TMGMTTranslatorMetadataController::entityPropertyInfo in includes/tmgmt.info.inc

File

includes/tmgmt.info.inc, line 161
Contains the metadata controller classes for the Translation Management Tool entities.

Code

function _tmgmt_override_property_description($info, $entity_type) {

  // Load tmgmt.install so we can access the schema.
  module_load_install('tmgmt');
  $entity_info = entity_get_info($entity_type);
  $schema = tmgmt_schema();
  $fields = $schema[$entity_info['base table']]['fields'];
  $properties =& $info[$entity_type]['properties'];
  foreach ($properties as $name => $property_info) {
    if (isset($fields[$name]['description'])) {
      $properties[$name]['description'] = $fields[$name]['description'];
    }
  }
  return $info;
}