Error message

  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).

public function JobItem::getStateIcon

Returns a render array to display a job item state icon.

Return value

array|null A render array for the icon or NULL if there is none for the current state.

Overrides JobItemInterface::getStateIcon

File

src/Entity/JobItem.php, line 1129

Class

JobItem
Entity class for the tmgmt_job_item entity.

Namespace

Drupal\tmgmt\Entity

Code

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'],
    ];
  }
}