You are here

public function Drupal8::termId in Realistic Dummy Content 3.x

Same name and namespace in other branches
  1. 8.2 api/src/Framework/Drupal8.php \Drupal\realistic_dummy_content_api\Framework\Drupal8::termId()
  2. 7.2 api/src/Framework/Drupal8.php \Drupal\realistic_dummy_content_api\Framework\Drupal8::termId()

Given a taxonomy term, return its id.

Parameters

object $term: Drupal taxonomy term object.

Return value

int The taxonomy term id.

Throws

\Exception

Overrides Framework::termId

File

api/src/Framework/Drupal8.php, line 440

Class

Drupal8
Drupal 8-specific code.

Namespace

Drupal\realistic_dummy_content_api\Framework

Code

public function termId($term) {
  return $term
    ->id();
}