You are here

public function JobItem::active in Translation Management Tool 8

Sets the state of the job item to 'active'.

Parameters

string $message: Message for the source to be reviewed.

array $variables: (optional) An array of variables to replace in the message on display.

string $type: (optional) Statically set to status.

Overrides JobItemInterface::active

File

src/Entity/JobItem.php, line 536

Class

JobItem
Entity class for the tmgmt_job_item entity.

Namespace

Drupal\tmgmt\Entity

Code

public function active($message = NULL, $variables = array(), $type = 'status') {
  if (!isset($message)) {
    $source_url = $this
      ->getSourceUrl();
    $message = $source_url ? 'The translation for <a href=":source_url">@source</a> is now being processed.' : 'The translation for @source is now being processed.';
    $variables = $source_url ? array(
      ':source_url' => $source_url
        ->toString(),
      '@source' => $this
        ->getSourceLabel(),
    ) : array(
      '@source' => $this
        ->getSourceLabel(),
    );
  }
  return $this
    ->setState(static::STATE_ACTIVE, $message, $variables, $type);
}