for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/* For licensing terms, see /license.txt */
declare(strict_types=1);
use Chamilo\CoreBundle\Event\CourseCreatedEvent;
use Chamilo\CoreBundle\Event\AbstractEvent;
use Chamilo\CoreBundle\Event\Events;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class H5pImportEventSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
return [
Events::COURSE_CREATED => 'onCreateCourse',
];
}
public function onCreateCourse(CourseCreatedEvent $event): void
if (AbstractEvent::TYPE_POST === $event->getType()) {
H5pImportPlugin::create()
->addCourseTool($event->getCourseInfo()['id'])
;