You are here

public function JobItem::label in Translation Management Tool 8

Gets the label of the entity.

Return value

string|null The label of the entity, or NULL if there is no label defined.

Overrides ContentEntityBase::label

File

src/Entity/JobItem.php, line 276

Class

JobItem
Entity class for the tmgmt_job_item entity.

Namespace

Drupal\tmgmt\Entity

Code

public function label($langcode = NULL) {
  $label = $this
    ->getSourceLabel() ?: parent::label();
  if (strlen($label) > Job::LABEL_MAX_LENGTH) {
    $label = Unicode::truncate($label, Job::LABEL_MAX_LENGTH, TRUE);
  }
  return $label;
}