interface LocalTaskItemInterface

Interface for tmgmt_local_task_item entity.

Hierarchy

  • interface \Drupal\tmgmt_local\LocalTaskItemInterface extends \Drupal\Core\Entity\ContentEntityInterface \Drupal\Core\Entity\EntityChangedInterface

Expanded class hierarchy of LocalTaskItemInterface

All classes that implement LocalTaskItemInterface

4 files declare their use of LocalTaskItemInterface
LocalTaskItem.php in translators/tmgmt_local/src/Entity/LocalTaskItem.php
Progress.php in translators/tmgmt_local/src/Plugin/views/field/Progress.php
TaskItemStatus.php in translators/tmgmt_local/src/Plugin/views/field/TaskItemStatus.php
TMGMTLocalBreadcrumbBuilder.php in translators/tmgmt_local/src/Menu/TMGMTLocalBreadcrumbBuilder.php

File

translators/tmgmt_local/src/LocalTaskItemInterface.php, line 13

Namespace

Drupal\tmgmt_local
View source
interface LocalTaskItemInterface extends ContentEntityInterface, EntityChangedInterface {

  /**
   * Translation task item is untranslated.
   */
  const STATUS_PENDING = 0;

  /**
   * Translation task item is translated and pending review of the job item.
   */
  const STATUS_COMPLETED = 1;

  /**
   * Translation job item has been rejected and the task needs to be updated.
   */
  const STATUS_REJECTED = 2;

  /**
   * The translation task item has been completed and closed.
   */
  const STATUS_CLOSED = 3;

  /**
   * Returns the translation task.
   *
   * @return \Drupal\tmgmt_local\Entity\LocalTask
   *   The LocalTask.
   */
  public function getTask();

  /**
   * Returns the translation job item.
   *
   * @return \Drupal\tmgmt\JobItemInterface
   *   The JobItem.
   */
  public function getJobItem();

  /**
   * Returns the status of the local task item.
   *
   * Can be one of the local task item status constants.
   *
   * @return int
   *   The status of the local task item.
   */
  public function getStatus();

  /**
   * Returns TRUE if the local task is pending.
   *
   * @return bool
   *   TRUE if the local task item is untranslated.
   */
  public function isPending();

  /**
   * Returns TRUE if the local task is translated (fully translated).
   *
   * @return bool
   *   TRUE if the local task item is translated.
   */
  public function isCompleted();

  /**
   * Returns TRUE if the local task is closed (translated and accepted).
   *
   * @return bool
   *   TRUE if the local task item is translated and accepted.
   */
  public function isClosed();

  /**
   * Sets the task item status to completed.
   */
  public function completed();

  /**
   * Sets the task item status to closed.
   */
  public function closed();

  /**
   * Updates the values for a specific substructure in the data array.
   *
   * The values are either set or updated but never deleted.
   *
   * @param string|array $key
   *   Key pointing to the item the values should be applied.
   *   The key can be either be an array containing the keys of a nested array
   *   hierarchy path or a string with '][' or '|' as delimiter.
   * @param array $values
   *   Nested array of values to set.
   * @param bool $replace
   *   (optional) When TRUE, replaces the structure at the provided key instead
   *   of writing into it.
   */
  public function updateData($key, $values = array(), $replace = FALSE);

  /**
   * Gets translation data.
   *
   * The structure is similar to the form API in the way that it is a possibly
   * nested array with the following properties whose presence indicate that the
   * current element is a text that might need to be translated.
   *
   * - #text: The translated text of the corresponding entry in the job item.
   * - #status: The status of the translation.
   *
   * The key can be an alphanumeric string.
   *
   * @param array $key
   *   If present, only the subarray identified by key is returned.
   * @param string $index
   *   Optional index of an attribute below $key.
   *
   * @return array
   *   A structured data array.
   */
  public function getData($key = array(), $index = NULL);

  /**
   * Gets count of all translated data items.
   *
   * @return int
   *   Translated count
   */
  public function getCountTranslated();

  /**
   * Gets count of all untranslated data items.
   *
   * @return int
   *   Translated count
   */
  public function getCountUntranslated();

  /**
   * Gets count of all completed data items.
   *
   * @return int
   *   Translated count
   */
  public function getCountCompleted();

  /**
   * Recalculates statistical word-data: pending, completed, rejected, closed.
   */
  public function recalculateStatistics();

  /**
   * Gets a labeled list of all available statuses.
   *
   * @return array
   *   A list of all available statuses.
   */
  public static function getStatuses();

}

Members

Namesort descending Modifiers Type Description Overrides
LocalTaskItemInterface::closed public function Sets the task item status to closed. 1
LocalTaskItemInterface::completed public function Sets the task item status to completed. 1
LocalTaskItemInterface::getCountCompleted public function Gets count of all completed data items. 1
LocalTaskItemInterface::getCountTranslated public function Gets count of all translated data items. 1
LocalTaskItemInterface::getCountUntranslated public function Gets count of all untranslated data items. 1
LocalTaskItemInterface::getData public function Gets translation data. 1
LocalTaskItemInterface::getJobItem public function Returns the translation job item. 1
LocalTaskItemInterface::getStatus public function Returns the status of the local task item. 1
LocalTaskItemInterface::getStatuses public static function Gets a labeled list of all available statuses. 1
LocalTaskItemInterface::getTask public function Returns the translation task. 1
LocalTaskItemInterface::isClosed public function Returns TRUE if the local task is closed (translated and accepted). 1
LocalTaskItemInterface::isCompleted public function Returns TRUE if the local task is translated (fully translated). 1
LocalTaskItemInterface::isPending public function Returns TRUE if the local task is pending. 1
LocalTaskItemInterface::recalculateStatistics public function Recalculates statistical word-data: pending, completed, rejected, closed. 1
LocalTaskItemInterface::STATUS_CLOSED constant The translation task item has been completed and closed.
LocalTaskItemInterface::STATUS_COMPLETED constant Translation task item is translated and pending review of the job item.
LocalTaskItemInterface::STATUS_PENDING constant Translation task item is untranslated.
LocalTaskItemInterface::STATUS_REJECTED constant Translation job item has been rejected and the task needs to be updated.
LocalTaskItemInterface::updateData public function Updates the values for a specific substructure in the data array. 1