ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCopyWizardOptions Class Reference
+ Collaboration diagram for ilCopyWizardOptions:

Public Member Functions

 getRequiredSteps ()
 
 saveOwner (int $a_user_id)
 Save owner for copy. More...
 
 saveRoot (int $a_root)
 Save root node id. More...
 
 isRootNode (int $a_root)
 Is root node public. More...
 
 getRootNode ()
 
 disableSOAP ()
 Disable soap calls. More...
 
 disableTreeCopy ()
 Disable copying of tree. More...
 
 isTreeCopyDisabled ()
 Check if tree copy is enabled. More...
 
 isSOAPEnabled ()
 Check if SOAP calls are disabled. More...
 
 checkOwner (int $a_user_id)
 check owner More...
 
 getCopyId ()
 
 initContainer (int $a_source_id, int $a_target_id)
 
 storeTree (int $a_source_id)
 Save tree Stores two copies of the tree structure: id 0 is used for recursive call of cloneObject() id -1 is used for recursive call of cloneDependencies() More...
 
 fetchFirstNode ()
 Fetch first node for cloneObject. More...
 
 fetchFirstDependenciesNode ()
 Fetch first dependencies node. More...
 
 dropFirstNodeById (int $a_id)
 Drop first node by id. More...
 
 dropFirstNode ()
 Drop first node (for cloneObject()) More...
 
 dropFirstDependenciesNode ()
 Drop first node (for cloneDependencies()) More...
 
 getOptions (int $a_source_id)
 Get entry by source public. More...
 
 addEntry (int $a_source_id, array $a_options)
 Add new entry. More...
 
 appendMapping ($a_source_id, $a_target_id)
 Add mapping of source -> target. More...
 
 getMappings ()
 
 deleteAll ()
 
 read ()
 

Static Public Member Functions

static _getInstance (int $a_copy_id)
 
static _isFinished (int $a_copy_id)
 
static _allocateCopyId ()
 Allocate a copy for further entries. More...
 

Data Fields

const COPY_WIZARD_UNDEFINED = 0
 
const COPY_WIZARD_OMIT = 1
 
const COPY_WIZARD_COPY = 2
 
const COPY_WIZARD_LINK = 3
 
const COPY_WIZARD_LINK_TO_TARGET = 4
 

Protected Attributes

const OWNER_KEY = -3
 
const DISABLE_SOAP = -4
 
const ROOT_NODE = -5
 
const DISABLE_TREE_COPY = -6
 
ilDBInterface $db
 
ilTree $tree
 

Private Member Functions

 __construct (int $a_copy_id=0)
 Private Constructor (Singleton class) More...
 
 fetchFirstNodeById ($a_id)
 Get first node of stored tree. More...
 
 readTree (int $a_source_id)
 Purge ommitted node recursively private. More...
 

Private Attributes

int $copy_id
 
array $options = []
 
array $tmp_tree = []
 

Static Private Attributes

static array $instances = []
 

Detailed Description

Definition at line 26 of file class.ilCopyWizardOptions.php.

Constructor & Destructor Documentation

◆ __construct()

ilCopyWizardOptions::__construct ( int  $a_copy_id = 0)
private

Private Constructor (Singleton class)

Definition at line 51 of file class.ilCopyWizardOptions.php.

References $DIC, and read().

52  {
53  global $DIC;
54 
55  $this->db = $DIC->database();
56  $this->tree = $DIC->repositoryTree();
57  $this->copy_id = $a_copy_id;
58 
59  if ($this->copy_id) {
60  $this->read();
61  }
62  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ _allocateCopyId()

static ilCopyWizardOptions::_allocateCopyId ( )
static

Allocate a copy for further entries.

Todo:
this is not thread safe

Definition at line 100 of file class.ilCopyWizardOptions.php.

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

Referenced by ilContainer\cloneAllObject(), ilObjPortfolioBase\clonePagesAndSettings(), ilObjectCopyGUI\copyMultipleNonContainer(), ilSoapObjectAdministration\copyObject(), and ilObjWorkspaceFolderGUI\performPasteIntoMultipleObjects().

100  : int
101  {
102  global $DIC;
103 
104  $ilDB = $DIC->database();
105  $query = "SELECT MAX(copy_id) latest FROM copy_wizard_options ";
106  $res = $ilDB->query($query);
107  $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
108 
109  $ilDB->insert("copy_wizard_options", array(
110  "copy_id" => array("integer", ((int) $row->latest) + 1),
111  "source_id" => array("integer", 0)
112  ));
113  return ((int) $row->latest) + 1;
114  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ _getInstance()

static ilCopyWizardOptions::_getInstance ( int  $a_copy_id)
static

Definition at line 64 of file class.ilCopyWizardOptions.php.

Referenced by ilAdvancedMDValues\_cloneValues(), ilObjTest\_getAvailableTests(), ilObject\_prepareCloneSelection(), ilObject\appendCopyInfo(), ilObjLearningSequence\cloneActivation(), ilContainer\cloneAllObject(), ilLPCollection\cloneCollection(), ilLPCollectionOfRepositoryObjects\cloneCollection(), ilCourseObjectiveMaterials\cloneDependencies(), ilCourseStart\cloneDependencies(), ilObjCategory\cloneDependencies(), ilCourseObjectiveQuestion\cloneDependencies(), ilContainerStartObjects\cloneDependencies(), ilObjectActivation\cloneDependencies(), ilConditionHandler\cloneDependencies(), ilObjCourseGrouping\cloneGrouping(), ilItemGroupItems\cloneItems(), ilEventItems\cloneItems(), ilObjSurveyQuestionPool\cloneObject(), ilObjBookingPool\cloneObject(), ilObjWiki\cloneObject(), ilObjGlossary\cloneObject(), ilObjCourse\cloneObject(), ilObjQuestionPool\cloneObject(), ilTestFixedQuestionSetConfig\cloneQuestionSetRelatedData(), ilLOTestAssignment\cloneSettings(), ilLOSettings\cloneSettings(), ilContainerSorting\cloneSorting(), ilLORandomTestQuestionPools\copy(), ilObjContentObject\copyAllPagesAndChapters(), ilObjectCopyGUI\copyMultipleNonContainer(), ilSoapObjectAdministration\copyObject(), ilObjMediaCast\copyOrder(), ilObjContentPage\doCloneObject(), ilObjPortfolioTemplate\doCloneObject(), ilObjDataCollection\doCloneObject(), ilObjBibliographic\doCloneObject(), ilObjPoll\doCloneObject(), ilObjItemGroup\fixContainerItemGroupRefsAfterCloning(), ilContainer\getCompleteDescriptions(), ilAdvancedMDValues\getParentMapping(), ilPCAMDForm\handleCopiedContent(), ilSoapUtils\ilClone(), ilSoapUtils\ilCloneDependencies(), ilObjSurvey\importObject(), ilObjectCopyProgressTableGUI\parse(), ilObjWorkspaceFolderGUI\performPasteIntoMultipleObjects(), ilObjFileBasedLM\populateByDirectoy(), ilObjSAHSLearningModule\populateByDirectoy(), ilTestRandomQuestionSetConfig\registerClonedSourcePoolDefinitionIdMapping(), ilCopyWizardOptionsTest\testSingleton(), ilObjForum\update(), ilObjectCopyGUI\updateProgress(), and ilObjContentObject\validatePages().

65  {
66  if (isset(self::$instances[$a_copy_id])) {
67  return self::$instances[$a_copy_id];
68  }
69  return self::$instances[$a_copy_id] = new ilCopyWizardOptions($a_copy_id);
70  }
+ Here is the caller graph for this function:

◆ _isFinished()

static ilCopyWizardOptions::_isFinished ( int  $a_copy_id)
static

Definition at line 84 of file class.ilCopyWizardOptions.php.

References $DIC, $ilDB, $query, and $res.

Referenced by ilContainerGUI\cloneAllObject(), and ilObjectCopyGUI\copyContainerToTargets().

84  : bool
85  {
86  global $DIC;
87 
88  $ilDB = $DIC->database();
89 
90  $query = "SELECT * FROM copy_wizard_options " .
91  "WHERE copy_id = " . $ilDB->quote($a_copy_id, 'integer') . " ";
92  $res = $ilDB->query($query);
93  return !$res->numRows();
94  }
$res
Definition: ltiservices.php:69
global $DIC
Definition: feed.php:28
$query
+ Here is the caller graph for this function:

◆ addEntry()

ilCopyWizardOptions::addEntry ( int  $a_source_id,
array  $a_options 
)

Add new entry.

Definition at line 353 of file class.ilCopyWizardOptions.php.

References $query, and $res.

Referenced by initContainer().

353  : void
354  {
355  $query = "DELETE FROM copy_wizard_options " .
356  "WHERE copy_id = " . $this->db->quote($this->copy_id, 'integer') . " " .
357  "AND source_id = " . $this->db->quote($a_source_id, 'integer');
358  $res = $this->db->manipulate($query);
359  $this->db->insert('copy_wizard_options', array(
360  'copy_id' => array('integer', $this->copy_id),
361  'source_id' => array('integer', $a_source_id),
362  'options' => array('clob', serialize($a_options))
363  ));
364  }
$res
Definition: ltiservices.php:69
$query
+ Here is the caller graph for this function:

◆ appendMapping()

ilCopyWizardOptions::appendMapping (   $a_source_id,
  $a_target_id 
)

Add mapping of source -> target.

Parameters
int  |  string$a_source_id
mixed$a_target_id
Returns
void

Definition at line 372 of file class.ilCopyWizardOptions.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and getCopyId().

Referenced by ilSoapUtils\cloneNode(), initContainer(), ilSoapUtils\internalLinkNode(), and ilSoapUtils\linkNode().

372  : void
373  {
374  $query = "SELECT * FROM copy_wizard_options " .
375  "WHERE copy_id = " . $this->db->quote($this->copy_id, 'integer') . " " .
376  "AND source_id = -2 ";
377  $res = $this->db->query($query);
378  $mappings = array();
379  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
380  $mappings = unserialize((string) $row->options);
381  }
382  $mappings[$a_source_id] = $a_target_id;
383 
384  $query = "DELETE FROM copy_wizard_options " .
385  "WHERE copy_id = " . $this->db->quote($this->getCopyId(), 'integer') . " " .
386  "AND source_id = -2 ";
387  $res = $this->db->manipulate($query);
388 
389  $this->db->insert('copy_wizard_options', array(
390  'copy_id' => array('integer', $this->getCopyId()),
391  'source_id' => array('integer', -2),
392  'options' => array('clob', serialize($mappings))
393  ));
394  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkOwner()

ilCopyWizardOptions::checkOwner ( int  $a_user_id)

check owner

Definition at line 220 of file class.ilCopyWizardOptions.php.

References getOptions().

220  : bool
221  {
222  return in_array($a_user_id, $this->getOptions(self::OWNER_KEY));
223  }
getOptions(int $a_source_id)
Get entry by source public.
+ Here is the call graph for this function:

◆ deleteAll()

ilCopyWizardOptions::deleteAll ( )

Definition at line 404 of file class.ilCopyWizardOptions.php.

References $query, and $res.

404  : void
405  {
406  if (isset(self::$instances[$this->copy_id])) {
407  unset(self::$instances[$this->copy_id]);
408  }
409  $query = "DELETE FROM copy_wizard_options " .
410  "WHERE copy_id = " . $this->db->quote($this->copy_id, 'integer');
411  $res = $this->db->manipulate($query);
412  }
$res
Definition: ltiservices.php:69
$query

◆ disableSOAP()

ilCopyWizardOptions::disableSOAP ( )

Disable soap calls.

Recursive call of ilClone and ilCloneDependencies

Definition at line 169 of file class.ilCopyWizardOptions.php.

References getCopyId().

169  : void
170  {
171  $this->options[self::DISABLE_SOAP] = 1;
172 
173  $this->db->insert("copy_wizard_options", array(
174  "copy_id" => array("integer", $this->getCopyId()),
175  "source_id" => array("integer", self::DISABLE_SOAP),
176  "options" => array('clob', serialize(array(1)))
177  ));
178  }
+ Here is the call graph for this function:

◆ disableTreeCopy()

ilCopyWizardOptions::disableTreeCopy ( )

Disable copying of tree.

Used for workspace copies

Definition at line 184 of file class.ilCopyWizardOptions.php.

References getCopyId().

184  : void
185  {
186  $this->options[self::DISABLE_TREE_COPY] = 1;
187 
188  $this->db->insert("copy_wizard_options", array(
189  "copy_id" => array("integer", $this->getCopyId()),
190  "source_id" => array("integer", self::DISABLE_TREE_COPY),
191  "options" => array('clob', serialize(array(1)))
192  ));
193  }
+ Here is the call graph for this function:

◆ dropFirstDependenciesNode()

ilCopyWizardOptions::dropFirstDependenciesNode ( )

Drop first node (for cloneDependencies())

Definition at line 332 of file class.ilCopyWizardOptions.php.

References dropFirstNodeById().

Referenced by ilSoapUtils\callNextDependency().

332  : bool
333  {
334  return $this->dropFirstNodeById(-1);
335  }
dropFirstNodeById(int $a_id)
Drop first node by id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dropFirstNode()

ilCopyWizardOptions::dropFirstNode ( )

Drop first node (for cloneObject())

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

References dropFirstNodeById().

Referenced by ilSoapUtils\callNextNode().

324  : bool
325  {
326  return $this->dropFirstNodeById(0);
327  }
dropFirstNodeById(int $a_id)
Drop first node by id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dropFirstNodeById()

ilCopyWizardOptions::dropFirstNodeById ( int  $a_id)

Drop first node by id.

Definition at line 296 of file class.ilCopyWizardOptions.php.

References fetchFirstNodeById(), getCopyId(), and read().

Referenced by dropFirstDependenciesNode(), and dropFirstNode().

296  : bool
297  {
298  if (!isset($this->options[$a_id]) || !is_array($this->options[$a_id])) {
299  return false;
300  }
301  $this->options[$a_id] = array_slice($this->options[$a_id], 1);
302 
303  $this->db->update('copy_wizard_options', array(
304  'options' => array('clob', serialize($this->options[$a_id]))
305  ), array(
306  'copy_id' => array('integer', $this->getCopyId()),
307  'source_id' => array('integer', $a_id)
308  ));
309 
310  $this->read();
311  // check for role_folder
312  if (($node = $this->fetchFirstNodeById($a_id)) === null) {
313  return true;
314  }
315  if ($node['type'] == 'rolf') {
316  $this->dropFirstNodeById($a_id);
317  }
318  return true;
319  }
fetchFirstNodeById($a_id)
Get first node of stored tree.
dropFirstNodeById(int $a_id)
Drop first node by id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchFirstDependenciesNode()

ilCopyWizardOptions::fetchFirstDependenciesNode ( )

Fetch first dependencies node.

Definition at line 288 of file class.ilCopyWizardOptions.php.

References fetchFirstNodeById().

288  : ?array
289  {
290  return $this->fetchFirstNodeById(-1);
291  }
fetchFirstNodeById($a_id)
Get first node of stored tree.
+ Here is the call graph for this function:

◆ fetchFirstNode()

ilCopyWizardOptions::fetchFirstNode ( )

Fetch first node for cloneObject.

Definition at line 280 of file class.ilCopyWizardOptions.php.

References fetchFirstNodeById().

280  : ?array
281  {
282  return $this->fetchFirstNodeById(0);
283  }
fetchFirstNodeById($a_id)
Get first node of stored tree.
+ Here is the call graph for this function:

◆ fetchFirstNodeById()

ilCopyWizardOptions::fetchFirstNodeById (   $a_id)
private

Get first node of stored tree.

Definition at line 268 of file class.ilCopyWizardOptions.php.

References getOptions().

Referenced by dropFirstNodeById(), fetchFirstDependenciesNode(), and fetchFirstNode().

268  : ?array
269  {
270  $tree = $this->getOptions($a_id);
271  if (isset($tree[0]) and is_array($tree[0])) {
272  return $tree[0];
273  }
274  return null;
275  }
getOptions(int $a_source_id)
Get entry by source public.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCopyId()

ilCopyWizardOptions::getCopyId ( )

◆ getMappings()

ilCopyWizardOptions::getMappings ( )

Definition at line 396 of file class.ilCopyWizardOptions.php.

Referenced by ilSoapUtils\cloneDependencies(), ilSoapUtils\cloneNode(), ilSoapUtils\findMappedReferenceForNode(), ilSoapUtils\internalLinkNode(), and ilSoapUtils\linkNode().

396  : array
397  {
398  if (isset($this->options[-2]) and is_array($this->options[-2])) {
399  return $this->options[-2];
400  }
401  return [];
402  }
+ Here is the caller graph for this function:

◆ getOptions()

ilCopyWizardOptions::getOptions ( int  $a_source_id)

Get entry by source public.

Parameters
intsource ref_id

Definition at line 342 of file class.ilCopyWizardOptions.php.

Referenced by checkOwner(), ilSoapUtils\cloneNode(), fetchFirstNodeById(), getRootNode(), isRootNode(), and ilSoapUtils\linkNode().

342  : array
343  {
344  if (isset($this->options[$a_source_id]) and is_array($this->options[$a_source_id])) {
345  return $this->options[$a_source_id];
346  }
347  return [];
348  }
+ Here is the caller graph for this function:

◆ getRequiredSteps()

ilCopyWizardOptions::getRequiredSteps ( )

Definition at line 72 of file class.ilCopyWizardOptions.php.

References $steps.

72  : int
73  {
74  $steps = 0;
75  if (array_key_exists(0, $this->options) && is_array($this->options[0])) {
76  $steps += count($this->options[0]);
77  }
78  if (array_key_exists(-1, $this->options) && is_array($this->options[-1])) {
79  $steps += count($this->options[-1]);
80  }
81  return $steps;
82  }
$steps
Definition: latex.php:3

◆ getRootNode()

ilCopyWizardOptions::getRootNode ( )

Definition at line 157 of file class.ilCopyWizardOptions.php.

References getOptions().

Referenced by ilSoapUtils\findMappedReferenceForNode().

157  : ?int
158  {
159  $options = $this->getOptions(self::ROOT_NODE);
160  if (!is_array($options) || !array_key_exists(0, $options)) {
161  return null;
162  }
163  return (int) $options[0];
164  }
getOptions(int $a_source_id)
Get entry by source public.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initContainer()

ilCopyWizardOptions::initContainer ( int  $a_source_id,
int  $a_target_id 
)

Definition at line 230 of file class.ilCopyWizardOptions.php.

References addEntry(), appendMapping(), and COPY_WIZARD_COPY.

230  : void
231  {
232  $mapping_source = $this->tree->getParentId($a_source_id);
233  $this->addEntry($a_source_id, array('type' => ilCopyWizardOptions::COPY_WIZARD_COPY));
234  $this->appendMapping($mapping_source, $a_target_id);
235  }
appendMapping($a_source_id, $a_target_id)
Add mapping of source -> target.
addEntry(int $a_source_id, array $a_options)
Add new entry.
+ Here is the call graph for this function:

◆ isRootNode()

ilCopyWizardOptions::isRootNode ( int  $a_root)

Is root node public.

Parameters
intref_id of copy

Definition at line 152 of file class.ilCopyWizardOptions.php.

References getOptions().

Referenced by ilSoapUtils\rewriteActionForNode().

152  : bool
153  {
154  return in_array($a_root, $this->getOptions(self::ROOT_NODE));
155  }
getOptions(int $a_source_id)
Get entry by source public.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSOAPEnabled()

ilCopyWizardOptions::isSOAPEnabled ( )

Check if SOAP calls are disabled.

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

Referenced by ilSoapUtils\callNextDependency(), and ilSoapUtils\callNextNode().

209  : bool
210  {
211  if (isset($this->options[self::DISABLE_SOAP]) and $this->options[self::DISABLE_SOAP]) {
212  return false;
213  }
214  return true;
215  }
+ Here is the caller graph for this function:

◆ isTreeCopyDisabled()

ilCopyWizardOptions::isTreeCopyDisabled ( )

Check if tree copy is enabled.

Definition at line 198 of file class.ilCopyWizardOptions.php.

198  : bool
199  {
200  if (isset($this->options[self::DISABLE_TREE_COPY]) && $this->options[self::DISABLE_TREE_COPY]) {
201  return true;
202  }
203  return false;
204  }

◆ read()

ilCopyWizardOptions::read ( )

Definition at line 414 of file class.ilCopyWizardOptions.php.

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

Referenced by __construct(), ilSoapUtils\callNextDependency(), ilSoapUtils\callNextNode(), and dropFirstNodeById().

414  : void
415  {
416  $query = "SELECT * FROM copy_wizard_options " .
417  "WHERE copy_id = " . $this->db->quote($this->copy_id, 'integer');
418  $res = $this->db->query($query);
419 
420  $this->options = [];
421  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
422  $this->options[(int) $row->source_id] = unserialize((string) $row->options);
423  }
424  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readTree()

ilCopyWizardOptions::readTree ( int  $a_source_id)
private

Purge ommitted node recursively private.

Parameters
arraycurrent node

Definition at line 431 of file class.ilCopyWizardOptions.php.

References $type, and ILIAS\Repository\int().

Referenced by storeTree().

431  : void
432  {
433  $this->tmp_tree[] = $this->tree->getNodeData($a_source_id);
434  foreach ($this->tree->getChilds($a_source_id) as $sub_nodes) {
435  $sub_node_ref_id = (int) $sub_nodes['child'];
436  // check ommited, linked ...
437  $options = $this->options[$sub_node_ref_id] ?? [];
438  $type = (int) ($options['type'] ?? 0);
439  if ($type === self::COPY_WIZARD_COPY or
440  $type === self::COPY_WIZARD_LINK) {
441  $this->readTree($sub_node_ref_id);
442  }
443  }
444  }
$type
readTree(int $a_source_id)
Purge ommitted node recursively private.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveOwner()

ilCopyWizardOptions::saveOwner ( int  $a_user_id)

Save owner for copy.

It will be checked against this user id in all soap calls

Definition at line 119 of file class.ilCopyWizardOptions.php.

References $DIC, $ilDB, and getCopyId().

119  : void
120  {
121  global $DIC;
122 
123  $ilDB = $DIC->database();
124  $ilDB->insert("copy_wizard_options", array(
125  "copy_id" => array("integer", $this->getCopyId()),
126  "source_id" => array("integer", self::OWNER_KEY),
127  "options" => array('clob', serialize(array($a_user_id)))
128  ));
129  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ saveRoot()

ilCopyWizardOptions::saveRoot ( int  $a_root)

Save root node id.

Definition at line 134 of file class.ilCopyWizardOptions.php.

References $DIC, $ilDB, and getCopyId().

134  : void
135  {
136  global $DIC;
137 
138  $ilDB = $DIC['ilDB'];
139 
140  $ilDB->insert("copy_wizard_options", array(
141  "copy_id" => array("integer", $this->getCopyId()),
142  "source_id" => array("integer", self::ROOT_NODE),
143  "options" => array('clob', serialize(array($a_root)))
144  ));
145  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ storeTree()

ilCopyWizardOptions::storeTree ( int  $a_source_id)

Save tree Stores two copies of the tree structure: id 0 is used for recursive call of cloneObject() id -1 is used for recursive call of cloneDependencies()

Definition at line 243 of file class.ilCopyWizardOptions.php.

References $tmp_tree, getCopyId(), and readTree().

243  : void
244  {
245  $this->tmp_tree = [];
246  $this->readTree($a_source_id);
247  $a_tree_structure = $this->tmp_tree;
248 
249  $this->db->update("copy_wizard_options", array(
250  "options" => array('clob', serialize($a_tree_structure))
251  ), array(
252  "copy_id" => array('integer', $this->getCopyId()),
253  "source_id" => array('integer',
254  0
255  )
256  ));
257 
258  $this->db->insert('copy_wizard_options', array(
259  'copy_id' => array('integer', $this->getCopyId()),
260  'source_id' => array('integer', -1),
261  'options' => array('clob', serialize($a_tree_structure))
262  ));
263  }
readTree(int $a_source_id)
Purge ommitted node recursively private.
+ Here is the call graph for this function:

Field Documentation

◆ $copy_id

int ilCopyWizardOptions::$copy_id
private

Definition at line 44 of file class.ilCopyWizardOptions.php.

Referenced by getCopyId().

◆ $db

ilDBInterface ilCopyWizardOptions::$db
protected

Definition at line 41 of file class.ilCopyWizardOptions.php.

◆ $instances

array ilCopyWizardOptions::$instances = []
staticprivate

Definition at line 28 of file class.ilCopyWizardOptions.php.

◆ $options

array ilCopyWizardOptions::$options = []
private

Definition at line 45 of file class.ilCopyWizardOptions.php.

◆ $tmp_tree

array ilCopyWizardOptions::$tmp_tree = []
private

Definition at line 46 of file class.ilCopyWizardOptions.php.

Referenced by storeTree().

◆ $tree

ilTree ilCopyWizardOptions::$tree
protected

Definition at line 42 of file class.ilCopyWizardOptions.php.

◆ COPY_WIZARD_COPY

◆ COPY_WIZARD_LINK

◆ COPY_WIZARD_LINK_TO_TARGET

const ilCopyWizardOptions::COPY_WIZARD_LINK_TO_TARGET = 4

Definition at line 34 of file class.ilCopyWizardOptions.php.

◆ COPY_WIZARD_OMIT

◆ COPY_WIZARD_UNDEFINED

const ilCopyWizardOptions::COPY_WIZARD_UNDEFINED = 0

Definition at line 30 of file class.ilCopyWizardOptions.php.

Referenced by ilSoapUtils\rewriteActionForNode().

◆ DISABLE_SOAP

const ilCopyWizardOptions::DISABLE_SOAP = -4
protected

Definition at line 37 of file class.ilCopyWizardOptions.php.

◆ DISABLE_TREE_COPY

const ilCopyWizardOptions::DISABLE_TREE_COPY = -6
protected

Definition at line 39 of file class.ilCopyWizardOptions.php.

◆ OWNER_KEY

const ilCopyWizardOptions::OWNER_KEY = -3
protected

Definition at line 36 of file class.ilCopyWizardOptions.php.

◆ ROOT_NODE

const ilCopyWizardOptions::ROOT_NODE = -5
protected

Definition at line 38 of file class.ilCopyWizardOptions.php.


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