ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilGlossaryObjDeletionHandler.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27{
29
30 public function __construct()
31 {
32 global $DIC;
33
34 $this->domain_service = $DIC->glossary()->internal()->domain();
35 }
36
37 public function processObjectDeletion(int $obj_id, string $obj_type): void
38 {
39 if ($obj_type == "usr" && ilObject::_lookupType($obj_id) == "usr") {
40 $flashcard_manager = $this->domain_service->flashcard(0, $obj_id);
41 $flashcard_manager->deleteAllUserEntries();
42 }
43 if ($obj_type == "glo" && ilObject::_lookupType($obj_id) == "glo") {
44 $flashcard_manager = $this->domain_service->flashcard((int) current(\ilObject::_getAllReferences($obj_id)));
45 $flashcard_manager->deleteAllGlossaryEntries();
46 }
47 }
48
49 public function processTermDeletion(int $term_id): void
50 {
51 $flashcard_manager = $this->domain_service->flashcard();
52 $flashcard_manager->deleteAllTermEntries($term_id);
53 }
54}
processObjectDeletion(int $obj_id, string $obj_type)
Glossary InternalDomainService $domain_service
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
global $DIC
Definition: shib_login.php:26