You are here

class TMGMTLocalTaskMetadataController in Translation Management Tool 7

Metadata controller for the local task entity.

Hierarchy

Expanded class hierarchy of TMGMTLocalTaskMetadataController

1 string reference to 'TMGMTLocalTaskMetadataController'
tmgmt_local_entity_info in translators/tmgmt_local/tmgmt_local.module
Implements hook_entity_info().

File

translators/tmgmt_local/includes/tmgmt_local.info.inc, line 12
Contains the metadata controller classes for the local task translatio entity.

View source
class TMGMTLocalTaskMetadataController extends EntityDefaultMetadataController {

  /**
   * {@inheritdoc}
   */
  public function entityPropertyInfo() {
    $info = parent::entityPropertyInfo();

    //    $info = _tmgmt_override_property_description($info, $this->type);
    $properties =& $info[$this->type]['properties'];

    // Make the created and changed property appear as date.
    $properties['changed']['type'] = $properties['created']['type'] = 'date';

    // Add the options list for the defined status constants.
    $properties['status']['options list'] = 'tmgmt_local_task_statuses';

    // Link the job property to the corresponding job entity.
    $properties['job'] = array(
      'label' => t('Translation Job'),
      'type' => 'tmgmt_job',
      'description' => t('Corresponding job entity of the translation task.'),
      'setter callback' => 'entity_property_verbatim_set',
      'setter permission' => 'administer tmgmt',
      'required' => TRUE,
      'schema field' => 'tjid',
    );

    // Link the author property to the corresponding user entity.
    $properties['author'] = array(
      'label' => t('Author'),
      'type' => 'user',
      'description' => t('The author of the translation task.'),
      'setter callback' => 'entity_property_verbatim_set',
      'setter permission' => 'administer tmgmt',
      'required' => TRUE,
      'schema field' => 'uid',
    );

    // Link the author property to the corresponding user entity.
    $properties['translator'] = array(
      'label' => t('Translator'),
      'type' => 'user',
      'description' => t('The assigned translator for translation task.'),
      'setter callback' => 'entity_property_verbatim_set',
      'setter permission' => 'administer tmgmt',
      'required' => TRUE,
      'schema field' => 'tuid',
    );
    return $info;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityDefaultMetadataController::$type protected property
EntityDefaultMetadataController::bundleOptionsList public static function A options list callback returning all bundles for an entity type.
EntityDefaultMetadataController::convertSchema protected function Return a set of properties for an entity based on the schema definition
EntityDefaultMetadataController::__construct public function
TMGMTLocalTaskMetadataController::entityPropertyInfo public function Overrides EntityDefaultMetadataController::entityPropertyInfo