/** * @param EntityId $entityId * * @throws LabelDescriptionLookupException * @return Term|null */ public function getDescription(EntityId $entityId) { try { $text = $this->termLookup->getDescription($entityId, $this->languageCode); } catch (TermLookupException $ex) { throw new LabelDescriptionLookupException($entityId, 'Failed to lookup description', $ex); } if ($text === null) { return null; } return new Term($this->languageCode, $text); }
/** * Gets the description of an Entity with the specified EntityId and language code. * * @param EntityId $entityId * @param string $languageCode * * @throws TermLookupException * @return string|null */ public function getDescription(EntityId $entityId, $languageCode) { return $this->termLookup->getDescription($entityId, $languageCode); }