You are here

public function ContributorPropertiesService::getDefaultCategory in Bibliography & Citation 8

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

Get first element of category list.

Return value

string|null Default category string.

Overrides ContributorPropertiesServiceInterface::getDefaultCategory

File

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

Class

ContributorPropertiesService
Class ContributorPropertiesService.

Namespace

Drupal\bibcite_entity

Code

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