You are here

public function TermHandler::getTermIdByName in Permissions by Term 8.2

Same name and namespace in other branches
  1. 8 src/Service/TermHandler.php \Drupal\permissions_by_term\Service\TermHandler::getTermIdByName()

Parameters

string $sTermName:

Return value

int|null

File

src/Service/TermHandler.php, line 123

Class

TermHandler

Namespace

Drupal\permissions_by_term\Service

Code

public function getTermIdByName($sTermName) {
  $resultArray = $this->termStorage
    ->getQuery()
    ->condition('name', $sTermName)
    ->execute();
  if (empty($resultArray)) {
    return NULL;
  }
  return $resultArray['0'];
}