ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TreeDBRepo.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
26{
27 public function __construct(
28 protected ilDBInterface $db
29 ) {
30 }
31
32 public function getTrashedSubtrees(int $ref_id): array
33 {
34 $db = $this->db;
35
36 // this queries for trash items in the trash of deleted nodes
37 $q = 'SELECT tree FROM tree WHERE parent = ' . $db->quote($ref_id, \ilDBConstants::T_INTEGER) .
38 ' AND tree < 0 ' .
39 ' AND tree = -1 * child';
40
41 $r = $db->query($q);
42
43 $tree_ids = [];
44 while ($row = $db->fetchObject($r)) {
45 $tree_ids = (int) $row->tree;
46 }
47 return $tree_ids;
48 }
49
50}
__construct(protected ilDBInterface $db)
Definition: TreeDBRepo.php:27
Interface ilDBInterface.
$ref_id
Definition: ltiauth.php:66
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$q
Definition: shib_logout.php:23