You are here

public function OpignoScorm::scormLoadSco in Opigno SCORM 8

Same name and namespace in other branches
  1. 3.x src/OpignoScorm.php \Drupal\opigno_scorm\OpignoScorm::scormLoadSco()

Load a SCO information.

Parameters

int $sco_id: Sco ID.

Return value

object|false SCO information.

File

src/OpignoScorm.php, line 287

Class

OpignoScorm
Class OpignoScorm.

Namespace

Drupal\opigno_scorm

Code

public function scormLoadSco($sco_id) {
  $connection = $this->database;
  $sco = $connection
    ->select('opigno_scorm_package_scos', 'o')
    ->fields('o', [])
    ->condition('id', $sco_id)
    ->execute()
    ->fetchObject();
  if ($sco) {
    $sco->attributes = $this
      ->scormLoadScormAttributes($sco->id);
  }
  return $sco;
}