ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilECSCourseUrl.php
Go to the documentation of this file.
1 <?php
2 
18 declare(strict_types=1);
19 
26 {
27  public const COURSE_URL_PREFIX = 'campusconnect/course/';
28 
29  private ilLogger $logger;
30 
31  // json fields
32  public string $cms_lecture_id = '';
33  public string $ecs_course_url = '';
34  public ?array $lms_course_urls = null;
35 
36  public function __construct()
37  {
38  global $DIC;
39 
40  $this->logger = $DIC->logger()->wsrv();
41  }
42 
46  public function setCmsLectureId(string $a_id): void
47  {
48  $this->cms_lecture_id = $a_id;
49  }
50 
54  public function setECSId(int $a_id): void
55  {
56  $this->ecs_course_url = self::COURSE_URL_PREFIX . $a_id;
57  }
58 
62  public function addLmsCourseUrls(ilECSCourseLmsUrl $lms_url = null): void
63  {
64  $this->lms_course_urls[] = $lms_url;
65  }
66 
70  public function send(ilECSSetting $setting, int $ecs_receiver_mid): void
71  {
72  try {
73  $con = new ilECSCourseUrlConnector($setting);
74  $con->addUrl($this, $ecs_receiver_mid);
75 
76  //$this->logger->info('Received new url id ' . $url_id);
77  } catch (Exception $e) {
78  $this->logger->error($e->getMessage());
79  }
80  }
81 }
send(ilECSSetting $setting, int $ecs_receiver_mid)
Send urls to ecs.
Connector for writing ecs course urls.
global $DIC
Definition: feed.php:28
setCmsLectureId(string $a_id)
Set lecture id.
setECSId(int $a_id)
Set ecs course id.
Represents a ecs course lms url.
addLmsCourseUrls(ilECSCourseLmsUrl $lms_url=null)
Add lms url.
Represents a ecs course url.