You are here

public static function MaestroEngine::getEntityIdentiferByUniqueID in Maestro 8.2

Same name and namespace in other branches
  1. 3.x src/Engine/MaestroEngine.php \Drupal\maestro\Engine\MaestroEngine::getEntityIdentiferByUniqueID()

Fetches the entity identifier (entity_id field) using the process ID and the unique ID given to the entity from the Maestro task. Technically, there should only be one entity identifier for the uniqueID.

Parameters

int $processID: The process ID from the workflow.

string $taskUniqueID: The unique identifier given to the entity in the task definition.

Return value

string The value of the entity_id field.

9 calls to MaestroEngine::getEntityIdentiferByUniqueID()
MaestroWebformTask::getExecutableForm in modules/maestro_webform/src/Plugin/EngineTasks/MaestroWebformTask.php
Gets the Maestro executable form for a task console.
maestro_content_type_task_submit in ./maestro.module
Handling the submission from a content type task. This will offload the saving from the content type task plugin.
maestro_form_approval_example_maestro_task_console_alter_execution_link in modules/examples/maestro_form_approval_example/maestro_form_approval_example.module
Implements hook_maestro_task_console_alter_execution_link().
maestro_form_approval_example_manager_approval_form in modules/examples/maestro_form_approval_example/maestro_form_approval_example.module
The manager approval form used in the workflow.
maestro_form_approval_example_set_flow_name_batch in modules/examples/maestro_form_approval_example/maestro_form_approval_example.module
Callback function for the batch function in the template.

... See full list

File

src/Engine/MaestroEngine.php, line 1002

Class

MaestroEngine
Class MaestroEngine.

Namespace

Drupal\maestro\Engine

Code

public static function getEntityIdentiferByUniqueID($processID, $taskUniqueID) {
  $value = NULL;
  $query = \Drupal::entityQuery('maestro_entity_identifiers')
    ->condition('process_id', $processID)
    ->condition('unique_id', $taskUniqueID);
  $entityID = current($query
    ->execute());
  if ($entityID) {
    $record = \Drupal::entityTypeManager()
      ->getStorage('maestro_entity_identifiers')
      ->load($entityID);
    if ($record) {
      $value = $record->entity_id
        ->getString();
    }
  }
  return $value;
}