File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
public/plugin/BuyCourses/src Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -805,22 +805,17 @@ public function getCourseInfo($courseId)
805805 'course_img ' => null ,
806806 ];
807807
808- $ courseTeachers = $ course ->getTeachersSubscriptions ();
809-
810- foreach ($ courseTeachers as $ teachers ) {
811- /* @var User $user */
808+ foreach ($ course ->getTeachersSubscriptions () as $ teachers ) {
812809 $ user = $ teachers ->getUser ();
813- $ teacher ['id ' ] = $ user ->getId ();
814- $ teacher ['name ' ] = $ user ->getFullName ();
815- $ courseInfo ['teachers ' ][] = $ teacher ;
810+ $ courseInfo ['teachers ' ][] = [
811+ 'id ' => $ user ->getId (),
812+ 'name ' => $ user ->getFullName (),
813+ ];
816814 }
817815
818- $ possiblePath = api_get_path (SYS_COURSE_PATH );
819- $ possiblePath .= $ course ->getDirectory ();
820- $ possiblePath .= '/course-pic.png ' ;
821-
822- if (file_exists ($ possiblePath )) {
823- $ courseInfo ['course_img ' ] = api_get_path (WEB_COURSE_PATH ).$ course ->getDirectory ().'/course-pic.png ' ;
816+ $ imgUrl = $ this ->getCourseIllustrationUrl ($ course );
817+ if (!empty ($ imgUrl )) {
818+ $ courseInfo ['course_img ' ] = $ imgUrl ;
824819 }
825820
826821 return $ courseInfo ;
You can’t perform that action at this time.
0 commit comments