Error message

Warning: count(): Parameter must be an array or an object that implements Countable in _api_make_match_member_link() (line 1230 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).

function tmgmt_translator_busy

Checks whether a translator with a certain name is busy and therefore can't be modified or deleted. A translator is considered 'busy' if there are jobs attached to it that are in an active state.

Parameters

$translator: The machine-readable name of a translator.

Return value

bool TRUE if the translator is busy, FALSE otherwise.

Related topics

1 call to tmgmt_translator_busy()

File

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

Code

function tmgmt_translator_busy($translator) {
  return (bool) \Drupal::entityQuery('tmgmt_job')
    ->accessCheck(TRUE)
    ->condition('state', [
    Job::STATE_ACTIVE,
    Job::STATE_CONTINUOUS,
  ], 'IN')
    ->condition('translator', $translator)
    ->range(0, 1)
    ->count()
    ->execute();
}