public function TestSource::getLabel

Return a title for this job item.

Parameters

string|false: The label of the job item entity.

Overrides SourcePluginBase::getLabel

File

tmgmt_test/src/Plugin/tmgmt/Source/TestSource.php, line 41

Class

TestSource
Test source plugin implementation.

Namespace

Drupal\tmgmt_test\Plugin\tmgmt\Source

Code

public function getLabel(JobItemInterface $job_item) {
  $label = $this->pluginId . ':' . $job_item
    ->getItemType() . ':' . $job_item
    ->getItemId();

  // We need to test if job and job item labels get properly truncated,
  // therefore in case the job item type is "test_with_long_label" we append
  // further text to the existing label.
  if ($job_item
    ->getItemType() == 'test_with_long_label') {
    $label .= 'Some very long and boring label that definitely exceeds hundred and twenty eight characters which is the maximum character count for the job item label.';
  }
  return $label;
}