public function TermHandler::getTermIdByName in Permissions by Term 8.2
Same name and namespace in other branches
- 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
Namespace
Drupal\permissions_by_term\ServiceCode
public function getTermIdByName($sTermName) {
$resultArray = $this->termStorage
->getQuery()
->condition('name', $sTermName)
->execute();
if (empty($resultArray)) {
return NULL;
}
return $resultArray['0'];
}