/** * Loads a tag object from its $remoteId. * * @throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException If the current user is not allowed to read tags * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If the specified tag is not found * * @param string $remoteId * @param array|null $languages A language filter for keywords. If not given all languages are returned. * @param bool $useAlwaysAvailable Add main language to $languages if true (default) and if tag is always available * * @return \Netgen\TagsBundle\API\Repository\Values\Tags\Tag */ public function loadTagByRemoteId($remoteId, array $languages = null, $useAlwaysAvailable = true) { if ($this->hasAccess('tags', 'read') !== true) { throw new UnauthorizedException('tags', 'read'); } $spiTag = $this->tagsHandler->loadByRemoteId($remoteId, $languages, $useAlwaysAvailable); return $this->buildTagDomainObject($spiTag); }