You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
class CourseContentEvaluation extends SoftDeletesModel
|
|
|
|
|
{
|
|
|
|
|
protected $appends = ['course_content'];
|
|
|
|
|
|
|
|
|
|
public function getCourseContentAttribute()
|
|
|
|
|
{
|
|
|
|
|
if (empty($this->course_content_id)) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
$course_content_id = explode(',', $this->course_content_id);
|
|
|
|
|
return CourseContent::whereIn('id', $course_content_id)->get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function course()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Course::class, 'course_id', 'id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function courseContentEvaluationAsks()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(CourseContentEvaluationAsk::class, 'course_content_evaluation_id', 'id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function courseContentEvaluationForms()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(CourseContentEvaluationForm::class, 'course_content_evaluation_id', 'id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|