You are here

LingotekTranslatableEntity.php in Lingotek Translation 7.2

Defines LingotekTranslatableEntity.

File

lib/Drupal/lingotek/LingotekTranslatableEntity.php
View source
<?php

/**
 * @file
 * Defines LingotekTranslatableEntity.
 */

/**
 * An interface for entities that are eligible for translation via the Lingotek platform.
 */
interface LingotekTranslatableEntity {

  /**
   * Gets the contents of this item formatted as XML that can be sent to Lingotek.
   *
   * @return string
   *   The XML document representing the entity's translatable content.
   */
  public function documentLingotekXML();

  /**
   * Gets a Lingotek metadata value for this item.
   *
   * @param string $key
   *   The key whose value should be returned.
   *
   * @return string
   *   The value for the specified key, if it exists.
   */
  public function getMetadataValue($key);

  /**
   * Sets a Lingotek metadata value for this item.
   *
   * @param string $key
   *   The key for a name/value pair.
   * @param string $value
   *   The value for a name/value pair.
   */
  public function setMetadataValue($key, $value);

  /**
   * Updates the local content with data from a Lingotek Document.
   *
   * @return bool
   *   TRUE if the content updates succeeded, FALSE otherwise.
   */
  public function updateLocalContent();

  /**
   * Gets the Lingotek document ID for this entity.
   *
   * @return mixed
   *   The integer document ID if the entity is associated with a
   *   Lingotek document. FALSE otherwise.
   */
  public function lingotekDocumentId();

}

Interfaces

Namesort descending Description
LingotekTranslatableEntity An interface for entities that are eligible for translation via the Lingotek platform.