Returns preview url if preview is supported.
\Drupal\tmgmt\JobItemInterface $job_item: Job item.
\Drupal\Core\Url Url object.
Overrides SourcePreviewInterface::getPreviewUrl
public function getPreviewUrl(JobItemInterface $job_item) {
if ($job_item
->getJob()
->isActive() && !($job_item
->isAborted() || $job_item
->isAccepted())) {
return new Url('tmgmt_content.job_item_preview', [
'tmgmt_job_item' => $job_item
->id(),
], [
'query' => [
'key' => \Drupal::service('tmgmt_content.key_access')
->getKey($job_item),
],
]);
}
else {
return NULL;
}
}