Get user ratings.

@param string|null $type Use class constants UsersExtension::RATING_TYPE_*
@return UserRatingsData
@throws RequestFailedException
@throws UnauthorizedException
@throws InvalidArgumentException
@throws InvalidJsonInResponseException
199590
public function getRatings(string $type = null): UserRatingsData
    {
        if ($type !== null && !in_array($type, self::$ratingTypes, true)) {
            throw new InvalidArgumentException(
                'Invalid rating type, use one of these instead: ' . implode(self::$ratingTypes, ', ')
            );
        }

        if ($type !== null) {
            $json = $this->client->performApiCallWithJsonResponse(
                'get',
                '/user/ratings/query',
                [
                    'query' => [
                        'itemType' => $type
                    ]
                ]
            );
        } else {
            $json = $this->client->performApiCallWithJsonResponse('get', '/user/ratings');
        }

        return ResponseHandler::create($json, ResponseHandler::METHOD_USER_RATINGS)->handle();
    }
280641
public function getState($type)
    {
        if (!isset($this->states[$type])) {
            return null;
        }

        return $this->states[$type];
    }
893128
public function getProfile($type) {
    // Get the OAuth token from LinkedIn.
    if (!$access_token = $this->authManager->getAccessToken($type)) {
      drupal_set_message($this->t('@network login failed. Token is not valid.', [
        '@network' => $this->t('LinkedIn'),
      ]), 'error');
      return $this->redirect('user.' . $type);
    }

    // Get user's LinkedIn profile from LinkedIn API.
    if (!($profile = $this->authManager->getProfile()) || empty($profile['id'])) {
      drupal_set_message($this->t('@network login failed, could not load @network profile. Contact the site administrator.', [
        '@network' => $this->t('LinkedIn'),
      ]), 'error');
      return $this->redirect('user.' . $type);
    }

    $this->accessToken = $access_token;

    return $profile;
  }
1003946
protected function getLevel($type)
    {
        if (!isset($this->types[$type])) {
            throw new InvalidArgumentException('Invalid log type.');
        }

        return $this->types[$type];
    }
1052760
public function getChatClassObject($type = null) {
        // Type is optional
        if ($type == null) return new Chat();

        $chatClassString = $this->getChatClassString($type);
        if ($chatClassString == null) {
            throw new Exception("Error Type");
        }

        $chatClassObject = new $chatClassString;

        return $chatClassObject;
    }
1107611
public static function getValue(string $type): string
    {
        switch ($type) {
            case '3':
                /* I18N: Quality of source information - GEDCOM tag “QUAY 3” */
                return I18N::translate('primary evidence');
            case '2':
                /* I18N: Quality of source information - GEDCOM tag “QUAY 2” */
                return I18N::translate('secondary evidence');
            case '1':
                /* I18N: Quality of source information - GEDCOM tag “QUAY 1” */
                return I18N::translate('questionable evidence');
            case '0':
                /* I18N: Quality of source information - GEDCOM tag “QUAY 0” */
                return I18N::translate('unreliable evidence');
            default:
                return $type;
        }
    }
958050
public function getAllPrivilegesByType($type)
    {
        $this->initialize();
        $privileges = [];
        foreach ($this->roles as $role) {
            $privileges = array_merge($privileges, $role->getPrivilegesByType($type));
        }
        return $privileges;
    }
158551
public function getUser($type, $id)
    {
        $response = $this->get('v1/users/'.$type.'/'.$id);

        if (is_null($response)) {
            return null;
        }

        return new NorthstarUser($response['data']);
    }
1303938
public TypeRating getRatings(Reference reference, RatingType type) {
		return getResourceFactory().getApiResource(
				"/rating/" + reference.toURLFragment() + type).get(
				TypeRating.class);
	}
959291
public function get($type)
    {
        if (!isset($this->instances[$type])) {
            $this->instances[$type] = $this->loadFile($type);
        }

        return $this->instances[$type];
    }
495850
public function getStatistics(string $type): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/enterprise/stats/:type', $type));
    }
654385
public function get_class($type)
	{
		if (!empty($this->classes[$type]))
		{
			return $this->classes[$type];
		}
		if (!empty($this->default[$type]))
		{
			return $this->default[$type];
		}

		return null;
	}
168549
protected function getPermissionField($type)
    {
        switch ($type) {
            case self::DELETE:
                // Delete uses edit type - Drop through
            case self::EDIT:
                return 'CanEditType';
            case self::VIEW:
                return 'CanViewType';
            default:
                throw new InvalidArgumentException("Invalid argument type $type");
        }
    }
1306494
public function lists($type = null)
    {
        $params = [
            'type' => $type,
        ];

        return $this->parseJSON('get', [self::API_LISTS, $params]);
    }
1094365
public function get($type)
    {
        if ($type === self::TYPE_MAILER) {
            $name = $this->configService->getValue('system_mailer');
        } elseif ($type === self::TYPE_DISPATCHER) {
            $name = $this->configService->getValue('system_dispatcher');
        } else {
            throw new \InvalidArgumentException('Provided type does not exist');
        }

        if (empty($name)) {
            return null;
        }

        return $this->connector->getConnection($name);
    }
725531
public function getAttributes( $type = null )
	{
		if( $type === null ) {
			return $this->_attributes;
		}

		$list = array();

		foreach( $this->_attributes as $attrItem )
		{
			if( $attrItem->getType() === $type ) {
				$list[] = $attrItem;
			}
		}

		return $list;
	}
601589
public static function getInstance($type)
  {
    $type = strtolower(preg_replace('/[^A-Z0-9_]/i', '', $type));

    if ( !isset(self::$instances[$type]) ){
      $class = __NAMESPACE__ . '\\'.ucfirst($type).'Format';
      
      if ( !class_exists($class) ){
        throw new \RuntimeException('Unable to read Registry/Format class ('.$type.')');
      }
      
      self::$instances[$type] = new $class;
    }
    
    return self::$instances[$type];
  }