function Term::getWeight

Gets the term weight.

Return value

int The term weight.

Overrides TermInterface::getWeight

File

core/modules/taxonomy/src/Entity/Term.php, line 269

Class

Term
Defines the taxonomy term entity.

Namespace

Drupal\taxonomy\Entity

Code

public function getWeight() {
  return (int) $this->get('weight')->value;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.