diff options
author | Khaled Lela <eng.khaled.lela@gmail.com> | 2022-02-10 18:59:23 +0200 |
---|---|---|
committer | Khaled Lela <eng.khaled.lela@gmail.com> | 2022-02-10 18:59:23 +0200 |
commit | e18d5c803a5bab898515fd87e1ca5de517b8d88f (patch) | |
tree | 81a6bd3e99b3933daf2d737dfb1347ad4f37c67c /src/Model | |
parent | 910f5cee7439466d797d9202c955b6c6540d45f1 (diff) |
fix storing Scorm sco children
Diffstat (limited to 'src/Model')
-rw-r--r-- | src/Model/ScormScoModel.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Model/ScormScoModel.php b/src/Model/ScormScoModel.php index de50741..d606d32 100644 --- a/src/Model/ScormScoModel.php +++ b/src/Model/ScormScoModel.php @@ -13,11 +13,18 @@ class ScormScoModel extends Model return config('scorm.table_names.scorm_sco_table', parent::getTable()); } - public function scorm() { + public function scorm() + { return $this->belongsTo(ScormModel::class, 'scorm_id', 'id'); } - public function scoTrackings() { + public function scoTrackings() + { return $this->hasMany(ScormScoTrackingModel::class, 'sco_id', 'id'); } + + public function children() + { + return $this->hasMany(ScormScoModel::class, 'sco_parent_id', 'id'); + } } |