ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ExerciseManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Exercise;
22
24{
25 public function __construct(
26 protected InternalRepoService $repo,
27 protected InternalDomainService $domain,
28 protected $obj_id
29 ) {
30 }
31
32 public function delete(
34 ): void {
35 // delete assignments
36 $ass_manager = $this->domain->assignment()->assignments(
37 $this->obj_id,
38 0
39 );
40 foreach ($ass_manager->getAll() as $assignment) {
41 $this->domain->assignment()->getAssignment(
42 $assignment->getId()
43 )->delete($exc, false);
44 }
45
46 foreach (\ilExcCriteriaCatalogue::getInstancesByParentId($this->obj_id) as $crit_cat) {
47 $crit_cat->delete();
48 }
49 }
50}
__construct(protected InternalRepoService $repo, protected InternalDomainService $domain, protected $obj_id)
static getInstancesByParentId(int $a_parent_id)
Class ilObjExercise.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...