ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSCTreeTasks Class Reference

Defines a system check task. More...

+ Collaboration diagram for ilSCTreeTasks:

Public Member Functions

 __construct (ilSCTask $task)
 
 getTask ()
 
 validateStructure ()
 
 checkStructure ()
 
 validateDuplicates ()
 
 checkDuplicates ()
 
 findMissingTreeEntries ()
 
 findMissing ()
 
 repairMissing ()
 
 repairMissingTreeEntries ()
 

Static Public Member Functions

static findDeepestDuplicate ()
 
static repairPK ()
 
static getNodeInfo (int $a_tree_id, int $a_child)
 
static getChilds (int $a_tree_id, int $a_childs)
 
static findDuplicates (int $a_duplicate_id)
 
static hasDuplicate (int $a_child)
 
static deleteDuplicateFromTree (int $a_duplicate_id, bool $a_delete_trash)
 

Protected Member Functions

 getDB ()
 
 repairMissingObject (int $a_parent_ref, int $a_ref_id)
 
 readMissing ()
 
 deleteMissingTreeEntry (int $a_tree_id, int $a_ref_id)
 
 readMissingTreeEntries ()
 Read missing tree entries for referenced objects Entry in tree but no entry in object reference. More...
 
 createRecoveryContainer ()
 

Static Protected Member Functions

static deleteDuplicate (int $tree_id, int $dup_id)
 

Protected Attributes

ilTree $tree
 
ilDBInterface $db
 

Private Attributes

ilSCTask $task
 

Detailed Description

Defines a system check task.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 10 of file class.ilSCTreeTasks.php.

Constructor & Destructor Documentation

◆ __construct()

ilSCTreeTasks::__construct ( ilSCTask  $task)

Definition at line 16 of file class.ilSCTreeTasks.php.

References $DIC, and $task.

17  {
18  global $DIC;
19  $this->db = $DIC->database();
20  $this->tree = $DIC->repositoryTree();
21  $this->task = $task;
22  }
global $DIC
Definition: feed.php:28

Member Function Documentation

◆ checkDuplicates()

ilSCTreeTasks::checkDuplicates ( )

Definition at line 228 of file class.ilSCTreeTasks.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by validateDuplicates().

228  : array
229  {
230  $query = 'SELECT child, count(child) num FROM tree ' .
231  'GROUP BY child ' .
232  'HAVING count(child) > 1';
233  $res = $this->db->query($query);
234 
235  $failures = array();
236  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
237  $failures[] = (int) $row->child;
238  }
239  return $failures;
240  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkStructure()

ilSCTreeTasks::checkStructure ( )

Definition at line 209 of file class.ilSCTreeTasks.php.

Referenced by validateStructure().

209  : array
210  {
211  return $this->tree->validateParentRelations();
212  }
+ Here is the caller graph for this function:

◆ createRecoveryContainer()

ilSCTreeTasks::createRecoveryContainer ( )
protected

Definition at line 403 of file class.ilSCTreeTasks.php.

References IL_CAL_DATETIME, IL_CAL_UNIX, and RECOVERY_FOLDER_ID.

Referenced by repairMissing().

403  : int
404  {
405  $now = new ilDateTime(time(), IL_CAL_UNIX);
406 
407  $folder = new ilObjFolder();
408  $folder->setTitle('__System check recovery: ' . $now->get(IL_CAL_DATETIME));
409  $folder->create();
410  $folder->createReference();
411  $folder->putInTree(RECOVERY_FOLDER_ID);
412 
413  return $folder->getRefId();
414  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_CAL_DATETIME
const IL_CAL_UNIX
const RECOVERY_FOLDER_ID
Definition: constants.php:37
+ Here is the caller graph for this function:

◆ deleteDuplicate()

static ilSCTreeTasks::deleteDuplicate ( int  $tree_id,
int  $dup_id 
)
staticprotected

Definition at line 162 of file class.ilSCTreeTasks.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ilDBConstants\T_INTEGER.

162  : void
163  {
164  global $DIC;
165 
166  $ilDB = $DIC->database();
167 
168  $query = 'SELECT child FROM tree ' .
169  'WHERE parent = ' . $ilDB->quote($dup_id, ilDBConstants::T_INTEGER) . ' ' .
170  'AND tree = ' . $ilDB->quote($tree_id, ilDBConstants::T_INTEGER);
171  $res = $ilDB->query($query);
172  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
173  // start recursion
174  self::deleteDuplicate($tree_id, (int) $row->child);
175  }
176  // now delete node
177  if (self::hasDuplicate($dup_id)) {
178  $query = 'DELETE FROM tree ' .
179  'WHERE child = ' . $ilDB->quote($dup_id, ilDBConstants::T_INTEGER) . ' ' .
180  'AND tree = ' . $ilDB->quote($tree_id, ilDBConstants::T_INTEGER);
181  $ilDB->manipulate($query);
182  }
183  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query

◆ deleteDuplicateFromTree()

static ilSCTreeTasks::deleteDuplicateFromTree ( int  $a_duplicate_id,
bool  $a_delete_trash 
)
static

Definition at line 148 of file class.ilSCTreeTasks.php.

Referenced by ilSCTreeTasksGUI\deleteDuplicatesFromRepository(), and ilSCTreeTasksGUI\deleteDuplicatesFromTrash().

148  : bool
149  {
150  $dups = self::findDuplicates($a_duplicate_id);
151  foreach ($dups as $dup) {
152  if ($a_delete_trash && $dup['tree'] < 1) {
153  self::deleteDuplicate($dup['tree'], $dup['child']);
154  }
155  if (!$a_delete_trash && $dup['tree'] == 1) {
156  self::deleteDuplicate($dup['tree'], $dup['child']);
157  }
158  }
159  return true;
160  }
+ Here is the caller graph for this function:

◆ deleteMissingTreeEntry()

ilSCTreeTasks::deleteMissingTreeEntry ( int  $a_tree_id,
int  $a_ref_id 
)
protected

Definition at line 352 of file class.ilSCTreeTasks.php.

References $factory, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ilDBConstants\T_INTEGER.

Referenced by repairMissingTreeEntries().

352  : void
353  {
354  $query = 'SELECT child FROM tree ' .
355  'WHERE parent = ' . $this->db->quote($a_ref_id, ilDBConstants::T_INTEGER) . ' ' .
356  'AND tree = ' . $this->db->quote($a_tree_id, ilDBConstants::T_INTEGER);
357 
358  $res = $this->db->query($query);
359  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
360  // check for duplicates
361  $query = 'SELECT tree, child FROM tree ' .
362  'WHERE child = ' . $this->db->quote($row->child, ilDBConstants::T_INTEGER);
363  $resd = $this->db->query($query);
364  while ($rowd = $resd->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
365  $this->deleteMissingTreeEntry((int) $rowd->tree, (int) $rowd->child);
366  }
367  }
368 
369  // finally delete
370 
371  $factory = new ilObjectFactory();
372  $ref_obj = $factory->getInstanceByRefId($a_ref_id, false);
373 
374  if (($ref_obj instanceof ilObject) && $ref_obj->getType()) {
375  $ref_obj->delete();
376  }
377 
378  $query = 'DELETE from tree ' .
379  'WHERE tree = ' . $this->db->quote($a_tree_id, ilDBConstants::T_INTEGER) . ' ' .
380  'AND child = ' . $this->db->quote($a_ref_id, ilDBConstants::T_INTEGER);
381  $this->db->manipulate($query);
382  }
$res
Definition: ltiservices.php:69
deleteMissingTreeEntry(int $a_tree_id, int $a_ref_id)
$query
$factory
Definition: metadata.php:75
+ Here is the caller graph for this function:

◆ findDeepestDuplicate()

static ilSCTreeTasks::findDeepestDuplicate ( )
static

Definition at line 24 of file class.ilSCTreeTasks.php.

References $DIC, $ilDB, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilSCTreeTasksGUI\repairDuplicates().

24  : int
25  {
26  global $DIC;
27 
28  $ilDB = $DIC->database();
29 
30  $query = 'SELECT child FROM tree first ' .
31  'WHERE EXISTS ( ' .
32  'SELECT child FROM tree second WHERE first.child = second.child ' .
33  'GROUP BY child HAVING COUNT(child) > 1 ) ' .
34  'ORDER BY depth DESC';
35 
36  $res = $ilDB->query($query);
37  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
38  return (int) $row->child;
39  }
40  return 0;
41  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ findDuplicates()

static ilSCTreeTasks::findDuplicates ( int  $a_duplicate_id)
static

Definition at line 112 of file class.ilSCTreeTasks.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), and ilDBConstants\T_INTEGER.

Referenced by ilSCTreeDuplicatesTableGUI\fillRow().

112  : array
113  {
114  global $DIC;
115 
116  $ilDB = $DIC->database();
117 
118  $query = 'SELECT * FROM tree first ' .
119  'WHERE EXISTS ( ' .
120  'SELECT child FROM tree second WHERE first.child = second.child ' .
121  'GROUP BY child HAVING COUNT(child) > 1 ) ' .
122  'AND child = ' . $ilDB->quote($a_duplicate_id, ilDBConstants::T_INTEGER) . ' ' .
123  'ORDER BY depth DESC';
124  $res = $ilDB->query($query);
125 
126  $nodes = array();
127  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
128  $node = array();
129  $node['tree'] = (int) $row->tree;
130  $node['child'] = (int) $row->child;
131  $node['depth'] = (int) $row->depth;
132 
133  $nodes[] = $node;
134  }
135 
136  return $nodes;
137  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findMissing()

ilSCTreeTasks::findMissing ( )

Definition at line 257 of file class.ilSCTreeTasks.php.

References getTask(), IL_CAL_UNIX, readMissing(), ilSCTask\STATUS_COMPLETED, and ilSCTask\STATUS_FAILED.

257  : int
258  {
259  $failures = $this->readMissing();
260 
261  if (count($failures)) {
262  $this->getTask()->setStatus(ilSCTask::STATUS_FAILED);
263  } else {
264  $this->getTask()->setStatus(ilSCTask::STATUS_COMPLETED);
265  }
266 
267  $this->getTask()->setLastUpdate(new ilDateTime(time(), IL_CAL_UNIX));
268  $this->getTask()->update();
269  return count($failures);
270  }
const STATUS_FAILED
const IL_CAL_UNIX
const STATUS_COMPLETED
+ Here is the call graph for this function:

◆ findMissingTreeEntries()

ilSCTreeTasks::findMissingTreeEntries ( )

Definition at line 242 of file class.ilSCTreeTasks.php.

References getTask(), IL_CAL_UNIX, readMissingTreeEntries(), ilSCTask\STATUS_COMPLETED, and ilSCTask\STATUS_FAILED.

242  : int
243  {
244  $failures = $this->readMissingTreeEntries();
245 
246  if (count($failures)) {
247  $this->getTask()->setStatus(ilSCTask::STATUS_FAILED);
248  } else {
249  $this->getTask()->setStatus(ilSCTask::STATUS_COMPLETED);
250  }
251 
252  $this->getTask()->setLastUpdate(new ilDateTime(time(), IL_CAL_UNIX));
253  $this->getTask()->update();
254  return count($failures);
255  }
readMissingTreeEntries()
Read missing tree entries for referenced objects Entry in tree but no entry in object reference...
const STATUS_FAILED
const IL_CAL_UNIX
const STATUS_COMPLETED
+ Here is the call graph for this function:

◆ getChilds()

static ilSCTreeTasks::getChilds ( int  $a_tree_id,
int  $a_childs 
)
static

Definition at line 93 of file class.ilSCTreeTasks.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), and ilDBConstants\T_INTEGER.

Referenced by ilSCTreeDuplicatesTableGUI\fillRow().

93  : array
94  {
95  global $DIC;
96 
97  $ilDB = $DIC->database();
98 
99  $query = 'SELECT * FROM tree WHERE tree = ' . $ilDB->quote(
100  $a_tree_id,
102  ) . ' ' . 'AND child = ' . $ilDB->quote($a_childs, ilDBConstants::T_INTEGER);
103  $res = $ilDB->query($query);
104 
105  $childs = array();
106  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
107  $childs[] = (int) $row->child;
108  }
109  return $childs;
110  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDB()

ilSCTreeTasks::getDB ( )
protected

Definition at line 185 of file class.ilSCTreeTasks.php.

References $db.

185  : ilDBInterface
186  {
187  return $this->db;
188  }
ilDBInterface $db

◆ getNodeInfo()

static ilSCTreeTasks::getNodeInfo ( int  $a_tree_id,
int  $a_child 
)
static

Definition at line 52 of file class.ilSCTreeTasks.php.

References $DIC, $ilDB, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), and ilDBConstants\T_INTEGER.

Referenced by ilSCTreeDuplicatesTableGUI\fillObjectRow().

52  : array
53  {
54  global $DIC;
55 
56  $ilDB = $DIC->database();
57 
58  $query = 'SELECT * FROM tree WHERE child = ' . $ilDB->quote(
59  $a_child,
61  ) . ' AND tree = ' . $ilDB->quote($a_tree_id, ilDBConstants::T_INTEGER);
62  $res = $ilDB->query($query);
63 
64  $node = array();
65  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
66  $node['child'] = (int) $row->child;
67  $node['tree'] = (int) $row->tree;
68  $node['depth'] = (int) $row->depth;
69 
70  // read obj_id
71  $query = 'SELECT obj_id FROM object_reference WHERE ref_id = ' . $ilDB->quote(
72  $a_child,
74  );
75  $ref_res = $ilDB->query($query);
76  while ($ref_row = $ref_res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
77  $node['obj_id'] = (int) $ref_row->obj_id;
78 
79  // read object info
80  $query = 'SELECT title, description, type FROM object_data ' .
81  'WHERE obj_id = ' . $ilDB->quote($ref_row->obj_id, ilDBConstants::T_INTEGER);
82  $obj_res = $ilDB->query($query);
83  while ($obj_row = $obj_res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
84  $node['title'] = (string) $obj_row->title;
85  $node['description'] = (string) $obj_row->description;
86  $node['type'] = (string) $obj_row->type;
87  }
88  }
89  }
90  return $node;
91  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTask()

ilSCTreeTasks::getTask ( )

Definition at line 190 of file class.ilSCTreeTasks.php.

References $task.

Referenced by findMissing(), findMissingTreeEntries(), validateDuplicates(), and validateStructure().

190  : ilSCTask
191  {
192  return $this->task;
193  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ hasDuplicate()

static ilSCTreeTasks::hasDuplicate ( int  $a_child)
static

Definition at line 139 of file class.ilSCTreeTasks.php.

References $DIC, and $ilDB.

139  : int
140  {
141  global $DIC;
142 
143  $ilDB = $DIC->database();
144 
145  return count(self::findDuplicates($a_child));
146  }
global $DIC
Definition: feed.php:28

◆ readMissing()

ilSCTreeTasks::readMissing ( )
protected
Returns
int[]

Definition at line 324 of file class.ilSCTreeTasks.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by findMissing(), and repairMissing().

324  : array
325  {
326  $query = 'SELECT ref_id FROM object_reference ' .
327  'LEFT JOIN tree ON ref_id = child ' .
328  'WHERE child IS NULL';
329  $res = $this->db->query($query);
330 
331  $failures = array();
332  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
333  $failures[] = (int) $row->ref_id;
334  }
335  return $failures;
336  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readMissingTreeEntries()

ilSCTreeTasks::readMissingTreeEntries ( )
protected

Read missing tree entries for referenced objects Entry in tree but no entry in object reference.

Definition at line 388 of file class.ilSCTreeTasks.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by findMissingTreeEntries(), and repairMissingTreeEntries().

388  : array
389  {
390  $query = 'SELECT child FROM tree ' .
391  'LEFT JOIN object_reference ON child = ref_id ' .
392  'WHERE ref_id IS NULL';
393 
394  $res = $this->db->query($query);
395 
396  $failures = array();
397  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
398  $failures[] = (int) $row->child;
399  }
400  return $failures;
401  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ repairMissing()

ilSCTreeTasks::repairMissing ( )

Definition at line 272 of file class.ilSCTreeTasks.php.

References $ref_id, createRecoveryContainer(), readMissing(), and repairMissingObject().

272  : void
273  {
274  $failures = $this->readMissing();
275  $recf_ref_id = $this->createRecoveryContainer();
276  foreach ($failures as $ref_id) {
277  $this->repairMissingObject($recf_ref_id, $ref_id);
278  }
279  }
repairMissingObject(int $a_parent_ref, int $a_ref_id)
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:

◆ repairMissingObject()

ilSCTreeTasks::repairMissingObject ( int  $a_parent_ref,
int  $a_ref_id 
)
protected

Definition at line 281 of file class.ilSCTreeTasks.php.

References $factory, $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ilDBConstants\T_INTEGER.

Referenced by repairMissing().

281  : void
282  {
283 
284  // check if object entry exist
285  $query = 'SELECT obj_id FROM object_reference ' .
286  'WHERE ref_id = ' . $this->db->quote($a_ref_id, ilDBConstants::T_INTEGER);
287 
288  $res = $this->db->query($query);
289  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
290  $query = 'SELECT type, title FROM object_data ' .
291  'WHERE obj_id = ' . $this->db->quote($row->obj_id, ilDBConstants::T_INTEGER);
292  $ores = $this->db->query($query);
293 
294  $done = false;
295  while ($orow = $ores->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
296  $done = true;
297 
298  $factory = new ilObjectFactory();
299  $ref_obj = $factory->getInstanceByRefId($a_ref_id, false);
300 
301  if ($ref_obj instanceof ilObjRoleFolder) {
302  $ref_obj->delete();
303  } elseif ($ref_obj instanceof ilObject) {
304  $ref_obj->putInTree($a_parent_ref);
305  $ref_obj->setPermissions($a_parent_ref);
306 
307  break;
308  }
309  }
310  if (!$done) {
311  // delete reference value
312  $query = 'DELETE FROM object_reference WHERE ref_id = ' . $this->db->quote(
313  $a_ref_id,
315  );
316  $this->db->manipulate($query);
317  }
318  }
319  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$res
Definition: ltiservices.php:69
$query
$factory
Definition: metadata.php:75
+ Here is the caller graph for this function:

◆ repairMissingTreeEntries()

ilSCTreeTasks::repairMissingTreeEntries ( )

Definition at line 338 of file class.ilSCTreeTasks.php.

References $query, $ref_id, $res, deleteMissingTreeEntry(), ilDBConstants\FETCHMODE_OBJECT, readMissingTreeEntries(), and ilDBConstants\T_INTEGER.

338  : void
339  {
340  $missing = $this->readMissingTreeEntries();
341  foreach ($missing as $ref_id) {
342  // check for duplicates
343  $query = 'SELECT tree, child FROM tree ' .
344  'WHERE child = ' . $this->db->quote($ref_id, ilDBConstants::T_INTEGER);
345  $res = $this->db->query($query);
346  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
347  $this->deleteMissingTreeEntry((int) $row->tree, $ref_id);
348  }
349  }
350  }
$res
Definition: ltiservices.php:69
readMissingTreeEntries()
Read missing tree entries for referenced objects Entry in tree but no entry in object reference...
deleteMissingTreeEntry(int $a_tree_id, int $a_ref_id)
$ref_id
Definition: ltiauth.php:67
$query
+ Here is the call graph for this function:

◆ repairPK()

static ilSCTreeTasks::repairPK ( )
static

Definition at line 43 of file class.ilSCTreeTasks.php.

References $DIC, and $ilDB.

Referenced by ilSCTreeTasksGUI\deleteDuplicatesFromRepository(), and ilSCTreeTasksGUI\deleteDuplicatesFromTrash().

43  : void
44  {
45  global $DIC;
46 
47  $ilDB = $DIC->database();
48 
49  $ilDB->addPrimaryKey('tree', array('child'));
50  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ validateDuplicates()

ilSCTreeTasks::validateDuplicates ( )

Definition at line 214 of file class.ilSCTreeTasks.php.

References checkDuplicates(), getTask(), IL_CAL_UNIX, ilSCTask\STATUS_COMPLETED, and ilSCTask\STATUS_FAILED.

214  : int
215  {
216  $failures = $this->checkDuplicates();
217 
218  if (count($failures)) {
219  $this->getTask()->setStatus(ilSCTask::STATUS_FAILED);
220  } else {
221  $this->getTask()->setStatus(ilSCTask::STATUS_COMPLETED);
222  }
223  $this->getTask()->setLastUpdate(new ilDateTime(time(), IL_CAL_UNIX));
224  $this->getTask()->update();
225  return count($failures);
226  }
const STATUS_FAILED
const IL_CAL_UNIX
const STATUS_COMPLETED
+ Here is the call graph for this function:

◆ validateStructure()

ilSCTreeTasks::validateStructure ( )

Definition at line 195 of file class.ilSCTreeTasks.php.

References checkStructure(), getTask(), IL_CAL_UNIX, ilSCTask\STATUS_COMPLETED, and ilSCTask\STATUS_FAILED.

195  : int
196  {
197  $failures = $this->checkStructure();
198 
199  if (count($failures)) {
200  $this->getTask()->setStatus(ilSCTask::STATUS_FAILED);
201  } else {
202  $this->getTask()->setStatus(ilSCTask::STATUS_COMPLETED);
203  }
204  $this->getTask()->setLastUpdate(new ilDateTime(time(), IL_CAL_UNIX));
205  $this->getTask()->update();
206  return count($failures);
207  }
const STATUS_FAILED
const IL_CAL_UNIX
const STATUS_COMPLETED
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilSCTreeTasks::$db
protected

Definition at line 13 of file class.ilSCTreeTasks.php.

Referenced by getDB().

◆ $task

ilSCTask ilSCTreeTasks::$task
private

Definition at line 14 of file class.ilSCTreeTasks.php.

Referenced by __construct(), and getTask().

◆ $tree

ilTree ilSCTreeTasks::$tree
protected

Definition at line 12 of file class.ilSCTreeTasks.php.


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