You are here

protected function TmgmtExtensionSuitTestBase::getNodeHash in TMGMT Extension Suite 8

Returns job item hash by node id and job id.

Parameters

$nid:

$jobId:

Return value

bool|mixed

2 calls to TmgmtExtensionSuitTestBase::getNodeHash()
CheckEntityChangesTest::testDoNotTrackTranslatableEntityChanges in src/Tests/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned off.
CheckEntityChangesTest::testTrackTranslatableEntityChanges in src/Tests/CheckEntityChangesTest.php
Test "Track changes of the translatable entities" feature is turned on.

File

src/Tests/TmgmtExtensionSuitTestBase.php, line 162

Class

TmgmtExtensionSuitTestBase
Basic class for tmgmt extension module.

Namespace

Drupal\tmgmt_extension_suit\Tests

Code

protected function getNodeHash($nid, $jobId) {
  $hashQuery = Drupal::database()
    ->select('tmgmt_job_item', 'tji');
  $hashQuery
    ->join('tmgmt_job', 'tj', 'tj.tjid = tji.tjid');
  $hash = $hashQuery
    ->condition('tj.tjid', $jobId)
    ->condition('tji.item_id', $nid)
    ->fields('tji', [
    'tjid',
    'tes_source_content_hash',
  ])
    ->execute()
    ->fetchAllKeyed();
  return $hash ? reset($hash) : FALSE;
}