Returns a render array to display a job item state icon.
array|null A render array for the icon or NULL if there is none for the current state.
Overrides JobItemInterface::getStateIcon
public function getStateIcon() {
$state_definitions = static::getStateDefinitions();
$state_definition = NULL;
$translator_state = $this
->getTranslatorState();
if ($translator_state && isset($state_definitions[$translator_state]['icon'])) {
$state_definition = $state_definitions[$translator_state];
}
elseif (isset($state_definitions[$this
->getState()]['icon'])) {
$state_definition = $state_definitions[$this
->getState()];
}
if ($state_definition) {
return [
'#theme' => 'image',
'#uri' => $state_definition['icon'],
'#title' => $state_definition['label'],
'#alt' => $state_definition['label'],
'#width' => 16,
'#height' => 16,
'#weight' => $state_definition['weight'],
];
}
}