ILIAS  trunk Revision v11.0_alpha-2406-g7062992332c
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
 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...
 

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 88 of file TreeStandardAdapter.php.

88  : void
89  {
90  $this->tree->deleteTree($node_data);
91  }

◆ getDeletedTreeNodeIds()

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

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 58 of file TreeStandardAdapter.php.

References $id.

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

◆ 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  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ getSubTree()

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

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 45 of file TreeStandardAdapter.php.

45  : array
46  {
47  return $this->tree->getSubTree($node);
48  }

◆ 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 97 of file TreeStandardAdapter.php.

97  : array
98  {
99  $tree_repo = $this->repo->tree();
100  return $tree_repo->getTrashedSubtrees($ref_id);
101  }
$ref_id
Definition: ltiauth.php:65

◆ getTrashTree()

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

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 74 of file TreeStandardAdapter.php.

References $user_id, and ilTree\lookupTreesForNode().

74  : TreeInterface
75  {
77  $tree_id = end($trees);
78 
79  if ($tree_id) {
80  if ($tree_id >= 0) {
81  throw new NotInTrashException('Trying to delete node from trash, but node is not in trash: ' . $ref_id);
82  }
83  return new self(new \ilTree($tree_id), $this->user_id);
84  }
85  throw new NotInTrashException('Trying to delete node from trash, but no valid tree id found for node id: ' . $ref_id);
86  }
static lookupTreesForNode(int $node_id)
$ref_id
Definition: ltiauth.php:65
+ 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 69 of file TreeStandardAdapter.php.

References $user_id.

69  : TreeInterface
70  {
71  return new self(new \ilTree($tree_id), $this->user_id);
72  }

◆ 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  }

◆ moveToTrash()

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

Implements ILIAS\Repository\Deletion\TreeInterface.

Definition at line 50 of file TreeStandardAdapter.php.

50  : bool
51  {
52  return $this->tree->moveToTrash($ref_id, true, $this->user_id);
53  }
$ref_id
Definition: ltiauth.php:65

◆ 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: