ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Repository\Deletion\EventStandardAdapter Class Reference
+ Inheritance diagram for ILIAS\Repository\Deletion\EventStandardAdapter:
+ Collaboration diagram for ILIAS\Repository\Deletion\EventStandardAdapter:

Public Member Functions

 __construct (protected InternalDomainService $domain,)
 
 beforeMoveToTrash (int $ref_id, array $subnodes)
 
 afterMoveToTrash (int $ref_id, int $old_parent_ref_id)
 
 beforeSubtreeRemoval (int $obj_id)
 
 beforeObjectRemoval (int $obj_id, int $ref_id, string $type, string $title)
 
 failedRemoval (int $obj_id, int $ref_id, string $type, string $title, string $message)
 
 afterObjectRemoval (int $obj_id, int $ref_id, string $type, int $old_parent_ref_id)
 
 afterTreeDeletion (int $tree_id, int $child)
 
 beforeMoveToTrash (int $ref_id, array $subnodes)
 
 afterMoveToTrash (int $ref_id, int $old_parent_ref_id)
 
 beforeSubtreeRemoval (int $obj_id)
 
 beforeObjectRemoval (int $obj_id, int $ref_id, string $type, string $title)
 
 failedRemoval (int $obj_id, int $ref_id, string $type, string $title, string $message)
 
 afterObjectRemoval (int $obj_id, int $ref_id, string $type, int $old_parent_ref_id)
 
 afterTreeDeletion (int $tree_id, int $child)
 

Protected Attributes

ilLogger $log
 
ilAppEventHandler $event_handler
 

Detailed Description

Definition at line 25 of file EventStandardAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Repository\Deletion\EventStandardAdapter::__construct ( protected InternalDomainService  $domain)

Definition at line 30 of file EventStandardAdapter.php.

32 {
33 $this->event_handler = $domain->event();
34 $this->log = $domain->logger()->root();
35 }

Member Function Documentation

◆ afterMoveToTrash()

ILIAS\Repository\Deletion\EventStandardAdapter::afterMoveToTrash ( int  $ref_id,
int  $old_parent_ref_id 
)

Implements ILIAS\Repository\Deletion\EventInterface.

Definition at line 44 of file EventStandardAdapter.php.

44 : void
45 {
46 $this->log->write("ilObjectGUI::confirmedDeleteObject(), moved ref_id " . $ref_id .
47 " to trash");
48
49 $this->event_handler->raise(
50 "components/ILIAS/ILIASObject",
51 "toTrash",
52 [
53 "obj_id" => \ilObject::_lookupObjId($ref_id),
54 "ref_id" => $ref_id,
55 "old_parent_ref_id" => $old_parent_ref_id
56 ]
57 );
58 }
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:66

References $ref_id, and ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ afterObjectRemoval()

ILIAS\Repository\Deletion\EventStandardAdapter::afterObjectRemoval ( int  $obj_id,
int  $ref_id,
string  $type,
int  $old_parent_ref_id 
)

Implements ILIAS\Repository\Deletion\EventInterface.

Definition at line 101 of file EventStandardAdapter.php.

106 : void {
107 $this->event_handler->raise(
108 "components/ILIAS/ILIASObject",
109 "delete",
110 [
111 "obj_id" => $obj_id,
112 "ref_id" => $ref_id,
113 "type" => $type,
114 "old_parent_ref_id" => $old_parent_ref_id
115 ]
116 );
117 }

◆ afterTreeDeletion()

ILIAS\Repository\Deletion\EventStandardAdapter::afterTreeDeletion ( int  $tree_id,
int  $child 
)

Implements ILIAS\Repository\Deletion\EventInterface.

Definition at line 119 of file EventStandardAdapter.php.

122 : void {
123 $this->log->info(
124 'deleted tree, tree_id: ' . $tree_id .
125 ', child: ' . $child
126 );
127 }

◆ beforeMoveToTrash()

ILIAS\Repository\Deletion\EventStandardAdapter::beforeMoveToTrash ( int  $ref_id,
array  $subnodes 
)

Implements ILIAS\Repository\Deletion\EventInterface.

Definition at line 37 of file EventStandardAdapter.php.

37 : void
38 {
39 // TODO: needs other handling
40 // This class shouldn't have to know anything about ECS
41 \ilECSObjectSettings::_handleDelete($subnodes); // why only subnodes?
42 }
static _handleDelete(array $a_subbtree_nodes)
handle delete Objects that are moved to the trash call ECS-Remove

References ilECSObjectSettings\_handleDelete().

+ Here is the call graph for this function:

◆ beforeObjectRemoval()

ILIAS\Repository\Deletion\EventStandardAdapter::beforeObjectRemoval ( int  $obj_id,
int  $ref_id,
string  $type,
string  $title 
)

Implements ILIAS\Repository\Deletion\EventInterface.

Definition at line 71 of file EventStandardAdapter.php.

76 : void {
77 $this->log->info(
78 'delete obj_id: ' . $obj_id .
79 ', ref_id: ' . $ref_id .
80 ', type: ' . $type .
81 ', title: ' . $title
82 );
83 }

◆ beforeSubtreeRemoval()

ILIAS\Repository\Deletion\EventStandardAdapter::beforeSubtreeRemoval ( int  $obj_id)

Implements ILIAS\Repository\Deletion\EventInterface.

Definition at line 60 of file EventStandardAdapter.php.

60 : void
61 {
62 // old wrandelshofer code, still needed?
64 $obj_id,
65 $this->domain->user()->getId(),
66 'purge',
67 null
68 );
69 }
static _recordWriteEvent(int $obj_id, int $usr_id, string $action, ?int $parent_obj_id=null)
Records a write event.

References ilChangeEvent\_recordWriteEvent().

+ Here is the call graph for this function:

◆ failedRemoval()

ILIAS\Repository\Deletion\EventStandardAdapter::failedRemoval ( int  $obj_id,
int  $ref_id,
string  $type,
string  $title,
string  $message 
)

Implements ILIAS\Repository\Deletion\EventInterface.

Definition at line 85 of file EventStandardAdapter.php.

91 : void {
92 $this->log->error(
93 'failed to remove obj_id: ' . $obj_id .
94 ', ref_id: ' . $ref_id .
95 ', type: ' . $type .
96 ', title: ' . $title .
97 ', message: ' . $message
98 );
99 }
$message
Definition: xapiexit.php:31

Field Documentation

◆ $event_handler

ilAppEventHandler ILIAS\Repository\Deletion\EventStandardAdapter::$event_handler
protected

Definition at line 28 of file EventStandardAdapter.php.

◆ $log

ilLogger ILIAS\Repository\Deletion\EventStandardAdapter::$log
protected

Definition at line 27 of file EventStandardAdapter.php.


The documentation for this class was generated from the following file: