ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ILIAS\Repository\Deletion\TreeStandardAdapter Class Reference
+ Inheritance diagram for ILIAS\Repository\Deletion\TreeStandardAdapter:
+ Collaboration diagram for ILIAS\Repository\Deletion\TreeStandardAdapter:

Public Member Functions

 __construct (protected InternalRepoService $repo, protected \ilTree $tree, protected int $user_id)
 
 isDeleted (int $node_id)
 
 useCache (bool $use)
 
 getNodeData (int $id)
 
 isInTree (int $id)
 
 getSubTree (array $node)
 
 moveToTrash (int $ref_id)
 
 getDeletedTreeNodeIds (array $ids)
 
 getTree (int $tree_id)
 
 getTrashTree (int $ref_id)
 
 deleteTree (array $node_data)
 
 getTrashedSubtrees (int $ref_id)
 Get (negative) tree ids of trashed children. More...
 
 isDeleted (int $a_node_id)
 
 useCache (bool $a_use)
 
 getNodeData (int $id)
 
 getSubTree (array $node)
 
 getDeletedTreeNodeIds (array $ids)
 
 getTree (int $tree_id)
 
 getTrashTree (int $ref_id)
 
 deleteTree (array $node_data)
 
 moveToTrash (int $ref_id)
 
 getTrashedSubtrees (int $ref_id)
 
 isInTree (int $id)
 

Detailed Description

Definition at line 25 of file TreeStandardAdapter.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Repository\Deletion\TreeStandardAdapter::__construct ( protected InternalRepoService  $repo,
protected \ilTree  $tree,
protected int  $user_id 
)

Definition at line 27 of file TreeStandardAdapter.php.

31 {
32 }

Member Function Documentation

◆ deleteTree()

ILIAS\Repository\Deletion\TreeStandardAdapter::deleteTree ( array  $node_data)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 100 of file TreeStandardAdapter.php.

100 : void
101 {
102 $this->tree->deleteTree($node_data);
103 }

◆ getDeletedTreeNodeIds()

ILIAS\Repository\Deletion\TreeStandardAdapter::getDeletedTreeNodeIds ( array  $ids)
Returns
int[]

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 62 of file TreeStandardAdapter.php.

62 : array
63 {
64 $deleted_ids = [];
65 foreach ($ids as $id) {
66 if ($this->tree->isDeleted($id)) {
67 $deleted_ids[] = $id;
68 }
69 }
70 return $deleted_ids;
71 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

◆ getNodeData()

ILIAS\Repository\Deletion\TreeStandardAdapter::getNodeData ( int  $id)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 41 of file TreeStandardAdapter.php.

41 : array
42 {
43 return $this->tree->getNodeData($id);
44 }

References $id.

◆ getSubTree()

ILIAS\Repository\Deletion\TreeStandardAdapter::getSubTree ( array  $node)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 49 of file TreeStandardAdapter.php.

49 : array
50 {
51 return $this->tree->getSubTree($node);
52 }

◆ getTrashedSubtrees()

ILIAS\Repository\Deletion\TreeStandardAdapter::getTrashedSubtrees ( int  $ref_id)

Get (negative) tree ids of trashed children.

Returns
int[]

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 109 of file TreeStandardAdapter.php.

109 : array
110 {
111 $tree_repo = $this->repo->tree();
112 return $tree_repo->getTrashedSubtrees($ref_id);
113 }
$ref_id
Definition: ltiauth.php:66

References $ref_id.

◆ getTrashTree()

ILIAS\Repository\Deletion\TreeStandardAdapter::getTrashTree ( int  $ref_id)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 82 of file TreeStandardAdapter.php.

82 : TreeInterface
83 {
85 $tree_id = end($trees);
86
87 if ($tree_id) {
88 if ($tree_id >= 0) {
89 throw new NotInTrashException('Trying to delete node from trash, but node is not in trash: ' . $ref_id);
90 }
91 return new self(
92 $this->repo,
93 new \ilTree($tree_id),
95 );
96 }
97 throw new NotInTrashException('Trying to delete node from trash, but no valid tree id found for node id: ' . $ref_id);
98 }
static lookupTreesForNode(int $node_id)

References $ref_id, $user_id, and ilTree\lookupTreesForNode().

+ Here is the call graph for this function:

◆ getTree()

ILIAS\Repository\Deletion\TreeStandardAdapter::getTree ( int  $tree_id)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 73 of file TreeStandardAdapter.php.

73 : TreeInterface
74 {
75 return new self(
76 $this->repo,
77 new \ilTree($tree_id),
79 );
80 }

References $user_id.

◆ isDeleted()

ILIAS\Repository\Deletion\TreeStandardAdapter::isDeleted ( int  $node_id)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 33 of file TreeStandardAdapter.php.

33 : bool
34 {
35 return $this->tree->isDeleted($node_id);
36 }

◆ isInTree()

ILIAS\Repository\Deletion\TreeStandardAdapter::isInTree ( int  $id)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 45 of file TreeStandardAdapter.php.

45 : bool
46 {
47 return $this->tree->isInTree($id);
48 }

References $id.

◆ moveToTrash()

ILIAS\Repository\Deletion\TreeStandardAdapter::moveToTrash ( int  $ref_id)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 54 of file TreeStandardAdapter.php.

54 : bool
55 {
56 return $this->tree->moveToTrash($ref_id, true, $this->user_id);
57 }

References $ref_id.

◆ useCache()

ILIAS\Repository\Deletion\TreeStandardAdapter::useCache ( bool  $use)

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 37 of file TreeStandardAdapter.php.

37 : void
38 {
39 $this->tree->useCache($use);
40 }

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