You are here

public function UserStatisticsManager::getSkillsAcquired in Opigno statistics 3.x

Get the list of skills acquired by the user.

Parameters

int $uid: The user ID. The current user will be taken by default.

Return value

array The list of skills acquired by the user.

1 call to UserStatisticsManager::getSkillsAcquired()
UserStatisticsManager::buildSkillsList in src/Services/UserStatisticsManager.php
Build the user skills list table.

File

src/Services/UserStatisticsManager.php, line 348

Class

UserStatisticsManager
User statistics manager service definition.

Namespace

Drupal\opigno_statistics\Services

Code

public function getSkillsAcquired(int $uid = 0) : array {
  if (!$uid) {
    $uid = $this->currentUid;
  }
  $query = $this->database
    ->select('opigno_skills_statistic', 'a')
    ->fields('a', [
    'tid',
    'stage',
  ])
    ->condition('a.uid', $uid);
  return $query
    ->execute()
    ->fetchAll();
}