You are here

function tmgmt_job_create in Translation Management Tool 8

Same name and namespace in other branches
  1. 7 tmgmt.module \tmgmt_job_create()

Creates a translation job.

Parameters

string $source_language: The source language from which should be translated.

string $target_language: The target language into which should be translated.

int $uid: The user ID.

array $values: (Optional) An array of additional entity values.

Return value

\Drupal\tmgmt\JobInterface The job entity. The job entity.

Related topics

32 calls to tmgmt_job_create()
CartForm::submitRequestTranslation in src/Form/CartForm.php
Custom form submit callback for tmgmt_cart_cart_form().
ConfigSourceUnitTest::testAccountSettings in sources/tmgmt_config/tests/src/Kernel/ConfigSourceUnitTest.php
Tests the user config entity.
ConfigSourceUnitTest::testNodeType in sources/tmgmt_config/tests/src/Kernel/ConfigSourceUnitTest.php
Tests the node type config entity.
ConfigSourceUnitTest::testSystemSite in sources/tmgmt_config/tests/src/Kernel/ConfigSourceUnitTest.php
Tests the view of the system site.
ConfigSourceUnitTest::testView in sources/tmgmt_config/tests/src/Kernel/ConfigSourceUnitTest.php
Tests the view config entity

... See full list

File

./tmgmt.module, line 299
Main module file for the Translation Management module.

Code

function tmgmt_job_create($source_language, $target_language, $uid = 0, array $values = array()) {
  return Job::create(array_merge($values, array(
    'source_language' => $source_language,
    'target_language' => $target_language,
    'uid' => $uid,
  )));
}