| Conditions | 5 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function onCreateCourse(CourseCreatedEvent $event): void |
||
| 32 | { |
||
| 33 | if (!$this->plugin->isEnabled(true)) { |
||
| 34 | return; |
||
| 35 | } |
||
| 36 | |||
| 37 | $linkRepo = $this->entityManager->getRepository(TopLink::class); |
||
| 38 | |||
| 39 | $course = $event->getCourse(); |
||
| 40 | |||
| 41 | if (AbstractEvent::TYPE_POST === $event->getType() && $course) { |
||
| 42 | foreach ($linkRepo->findAll() as $link) { |
||
| 43 | $this->plugin->addToolInCourse($course->getId(), $link); |
||
| 44 | } |
||
| 48 |