You are here

public function ContributorPropertiesService::getDefaultRole in Bibliography & Citation 2.0.x

Same name and namespace in other branches
  1. 8 modules/bibcite_entity/src/ContributorPropertiesService.php \Drupal\bibcite_entity\ContributorPropertiesService::getDefaultRole()

Get first element of role list.

Return value

string|null Default role string.

Overrides ContributorPropertiesServiceInterface::getDefaultRole

File

modules/bibcite_entity/src/ContributorPropertiesService.php, line 69

Class

ContributorPropertiesService
Class ContributorPropertiesService.

Namespace

Drupal\bibcite_entity

Code

public function getDefaultRole() {
  $list = $this
    ->getRoles();
  if (!empty($list)) {
    reset($list);
    return key($list);
  }
  else {
    return NULL;
  }
}