ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCourseObjectiveMaterials Class Reference

class ilCourseObjectiveMaterials More...

+ Collaboration diagram for ilCourseObjectiveMaterials:

Public Member Functions

 __construct ($a_objective_id)
 
 cloneDependencies ($a_new_objective, $a_copy_id)
 clone objective materials More...
 
 getMaterials ()
 
 getChapters ()
 
 getLM ($lm_id)
 
 getObjectiveId ()
 
 setLMRefId ($a_ref_id)
 
 getLMRefId ()
 
 setLMObjId ($a_obj_id)
 
 getLMObjId ()
 
 setType ($a_type)
 
 getType ()
 
 isAssigned ($a_ref_id, $a_get_id=false)
 Check if material is assigned. More...
 
 isChapterAssigned ($a_ref_id, $a_obj_id)
 Check if chapter is assigned. More...
 
 checkExists ()
 
 add ()
 
 delete ($lm_id)
 
 deleteMaterial (int $ref_id, int $obj_id)
 
 isMaterialAssigned (int $ref_id, int $obj_id)
 
 deleteAll ()
 
 writePosition ($a_ass_id, $a_position)
 write position More...
 
 __read ()
 
 toXml (ilXmlWriter $writer)
 

Static Public Member Functions

static _getAssignedMaterials ($a_objective_id)
 get assigned materials More...
 
static _getAssignableMaterials ($a_container_id)
 Get an array of course material ids that can be assigned to learning objectives No tst, fold and grp. More...
 
static _getAllAssignedMaterials ($a_container_id)
 Get all assigned materials. More...
 

Data Fields

 $db = null
 
 $objective_id = null
 
 $lms
 

Detailed Description

class ilCourseObjectiveMaterials

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
lass.ilCourseObjectiveMaterials.php 13383 2007-03-02 10:54:46 +0000 (Fr, 02 Mrz 2007) smeyer

Definition at line 33 of file class.ilCourseObjectiveMaterials.php.

Constructor & Destructor Documentation

◆ __construct()

ilCourseObjectiveMaterials::__construct (   $a_objective_id)

Definition at line 40 of file class.ilCourseObjectiveMaterials.php.

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

41  {
42  global $DIC;
43 
44  $ilDB = $DIC['ilDB'];
45 
46  $this->db = &$ilDB;
47 
48  $this->objective_id = $a_objective_id;
49 
50  $this->__read();
51  }
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the call graph for this function:

Member Function Documentation

◆ __read()

ilCourseObjectiveMaterials::__read ( )

Definition at line 452 of file class.ilCourseObjectiveMaterials.php.

References $DIC, $ilDB, $query, $res, ilLMObject\_exists(), ilObject\_getAllReferences(), ilCourseObjective\_lookupContainerIdByObjectiveId(), ilDBConstants\FETCHMODE_OBJECT, and getObjectiveId().

Referenced by __construct().

453  {
454  global $DIC;
455 
456  $tree = $DIC['tree'];
457  $ilDB = $DIC['ilDB'];
458 
459  include_once('Modules/Course/classes/class.ilCourseObjective.php');
460  $container_ref_ids = ilObject::_getAllReferences(ilCourseObjective::_lookupContainerIdByObjectiveId($this->objective_id));
461  $container_ref_id = current($container_ref_ids);
462 
463  // begin-patch lok
464 
465  $this->lms = array();
466  $query = "SELECT position,lm_ass_id,lm.ref_id,lm.obj_id,lm.type FROM crs_objective_lm lm " .
467  "JOIN object_reference obr ON lm.ref_id = obr.ref_id " .
468  "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
469  "LEFT JOIN lm_data lmd ON lmd.obj_id = lm.obj_id " .
470  "WHERE objective_id = " . $ilDB->quote($this->getObjectiveId(), 'integer') . " " .
471  "ORDER BY position,obd.title,lmd.title";
472 
473  $res = $this->db->query($query);
474  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
475  if (!$tree->isInTree($row->ref_id) or !$tree->isGrandChild($container_ref_id, $row->ref_id)) {
476  $this->delete($row->lm_ass_id);
477  continue;
478  }
479  if (
480  $row->obj_id > 0 &&
481  ($row->type == 'pg' || $row->type == 'st') &&
482  !ilLMObject::_exists($row->obj_id)
483  ) {
484  continue;
485  }
486  $lm['ref_id'] = $row->ref_id;
487  $lm['obj_id'] = $row->obj_id;
488  $lm['type'] = $row->type;
489  $lm['lm_ass_id'] = $row->lm_ass_id;
490  $lm['position'] = $row->position;
491 
492  $this->lms[$row->lm_ass_id] = $lm;
493  }
494 
495  // end-patch lok
496 
497  return true;
498  }
static _lookupContainerIdByObjectiveId($a_objective_id)
Get container of object.
static _exists($a_id)
checks wether a lm content object with specified id exists or not
static _getAllReferences($a_id)
get all reference ids of object
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getAllAssignedMaterials()

static ilCourseObjectiveMaterials::_getAllAssignedMaterials (   $a_container_id)
static

Get all assigned materials.

public

Parameters
in

Definition at line 211 of file class.ilCourseObjectiveMaterials.php.

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

212  {
213  global $DIC;
214 
215  $ilDB = $DIC['ilDB'];
216 
217  $query = "SELECT DISTINCT(com.ref_id) ref_id FROM crs_objectives co " .
218  "JOIN crs_objective_lm com ON co.objective_id = com.objective_id " .
219  "JOIN object_reference obr ON com.ref_id = obr.ref_id " .
220  "JOIN object_data obd ON obr.obj_id = obd.obj_id " .
221  "WHERE co.crs_id = " . $ilDB->quote($a_container_id, 'integer') . " " .
222  "ORDER BY obd.title ";
223 
224  $res = $ilDB->query($query);
225  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
226  $ref_ids[] = $row->ref_id;
227  }
228  return $ref_ids ? $ref_ids : array();
229  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB

◆ _getAssignableMaterials()

static ilCourseObjectiveMaterials::_getAssignableMaterials (   $a_container_id)
static

Get an array of course material ids that can be assigned to learning objectives No tst, fold and grp.

public

Parameters
intobj id of course
Returns
array data of course materials

Definition at line 164 of file class.ilCourseObjectiveMaterials.php.

References $DIC, $ilDB, $type, ilObject\_lookupObjId(), ilLOTestAssignments\getInstance(), ilUtil\sortArray(), and ilLOSettings\TYPE_TEST_UNDEFINED.

Referenced by ilCourseObjectivesGUI\materialAssignment().

165  {
166  global $DIC;
167 
168  $tree = $DIC['tree'];
169  $ilDB = $DIC['ilDB'];
170 
171  $container_obj_id = ilObject::_lookupObjId($a_container_id);
172 
173  $all_materials = $tree->getSubTree($tree->getNodeData($a_container_id), true);
174  $all_materials = ilUtil::sortArray($all_materials, 'title', 'asc');
175 
176  // Filter
177  foreach ($all_materials as $material) {
178  switch ($material['type']) {
179  case 'tst':
180 
181  include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
182  $type = ilLOTestAssignments::getInstance($container_obj_id)->getTypeByTest($material['child']);
184  break;
185  }
186 
187  $assignable[] = $material;
188  break;
189 
190  case 'crs':
191  case 'rolf':
192  case 'itgr':
193  break;
194 
195  default:
196  $assignable[] = $material;
197  break;
198  }
199  }
200  return $assignable ? $assignable : array();
201  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static getInstance($a_container_id)
Get instance by container id.
$type
static _lookupObjId($a_id)
global $DIC
Definition: goto.php:24
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getAssignedMaterials()

static ilCourseObjectiveMaterials::_getAssignedMaterials (   $a_objective_id)
static

get assigned materials

public

Parameters
intobjective_id
Returns

Definition at line 137 of file class.ilCourseObjectiveMaterials.php.

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

Referenced by ilContainerObjectiveGUI\buildObjectiveMap(), and ilObjectActivation\getItemsByObjective().

138  {
139  global $DIC;
140 
141  $ilDB = $DIC['ilDB'];
142 
143  $query = "SELECT DISTINCT(ref_id) ref_id FROM crs_objective_lm " .
144  "WHERE objective_id = " . $ilDB->quote($a_objective_id, 'integer');
145  $res = $ilDB->query($query);
146  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
147  $ref_ids[] = $row->ref_id;
148  }
149  return $ref_ids ? $ref_ids : array();
150  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the caller graph for this function:

◆ add()

ilCourseObjectiveMaterials::add ( )

Definition at line 358 of file class.ilCourseObjectiveMaterials.php.

References $DIC, $ilDB, $query, $res, getLMObjId(), getLMRefId(), getObjectiveId(), and getType().

359  {
360  global $DIC;
361 
362  $ilDB = $DIC['ilDB'];
363 
364  $next_id = $ilDB->nextId('crs_objective_lm');
365  $query = "INSERT INTO crs_objective_lm (lm_ass_id,objective_id,ref_id,obj_id,type) " .
366  "VALUES( " .
367  $ilDB->quote($next_id, 'integer') . ", " .
368  $ilDB->quote($this->getObjectiveId(), 'integer') . ", " .
369  $ilDB->quote($this->getLMRefId(), 'integer') . ", " .
370  $ilDB->quote($this->getLMObjId(), 'integer') . ", " .
371  $ilDB->quote($this->getType(), 'text') .
372  ")";
373  $res = $ilDB->manipulate($query);
374 
375  return (int) $next_id;
376  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ checkExists()

ilCourseObjectiveMaterials::checkExists ( )

Definition at line 336 of file class.ilCourseObjectiveMaterials.php.

References $DIC, $ilDB, $query, $res, getLMObjId(), getLMRefId(), and getObjectiveId().

337  {
338  global $DIC;
339 
340  $ilDB = $DIC['ilDB'];
341 
342  if ($this->getLMObjId()) {
343  $query = "SELECT * FROM crs_objective_lm " .
344  "WHERE objective_id = " . $ilDB->quote($this->getObjectiveId(), 'integer') . " " .
345  "AND ref_id = " . $ilDB->quote($this->getLMRefId(), 'integer') . " " .
346  "AND obj_id = " . $ilDB->quote($this->getLMObjId(), 'integer') . " ";
347  } else {
348  $query = "SELECT * FROM crs_objective_lm " .
349  "WHERE objective_id = " . $ilDB->quote($this->getObjectiveId(), 'integer') . " " .
350  "AND ref_id = " . $ilDB->quote($this->getLMRefId(), 'integer') . " ";
351  }
352 
353  $res = $this->db->query($query);
354 
355  return $res->numRows() ? true : false;
356  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ cloneDependencies()

ilCourseObjectiveMaterials::cloneDependencies (   $a_new_objective,
  $a_copy_id 
)

clone objective materials

public

Parameters
intsource objective
inttarget objective
intcopy id

Definition at line 62 of file class.ilCourseObjectiveMaterials.php.

References $DIC, ilCopyWizardOptions\_getInstance(), and getMaterials().

63  {
64  global $DIC;
65 
66  $ilObjDataCache = $DIC['ilObjDataCache'];
67  $ilLog = $DIC['ilLog'];
68 
69  include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
70  $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
71  $mappings = $cwo->getMappings();
72  #$ilLog->write(__METHOD__.': 1');
73  foreach ($this->getMaterials() as $material) {
74  #$ilLog->write(__METHOD__.': 2');
75  // Copy action omit ?
76  if (!isset($mappings[$material['ref_id']]) or !$mappings[$material['ref_id']]) {
77  continue;
78  }
79  #$ilLog->write(__METHOD__.': 3');
80  $material_ref_id = $material['ref_id'];
81  $material_rbac_obj_id = $ilObjDataCache->lookupObjId($material_ref_id);
82  $material_obj_id = $material['obj_id'];
83  $new_ref_id = $mappings[$material_ref_id];
84  $new_rbac_obj_id = $ilObjDataCache->lookupObjId($new_ref_id);
85  #$ilLog->write(__METHOD__.': 4');
86 
87  // Link
88  if ($new_rbac_obj_id == $material_rbac_obj_id) {
89  #$ilLog->write(__METHOD__.': 5');
90  $ilLog->write(__METHOD__ . ': Material has been linked. Keeping object id.');
91  $new_obj_id = $material_obj_id;
92  } elseif ($material['type'] == 'st' or $material['type'] == 'pg') {
93 
94  #$GLOBALS['DIC']['ilLog']->write(__METHOD__.': '.print_r($material,TRUE));
95  #$GLOBALS['DIC']['ilLog']->write(__METHOD__.': '.print_r($mappings,TRUE));
96 
97  #$ilLog->write(__METHOD__.': 6');
98  // Chapter assignment
99  $new_material_info = isset($mappings[$material_ref_id . '_' . $material_obj_id]) ?
100  $mappings[$material_ref_id . '_' . $material_obj_id] :
101  '';
102  $new_material_arr = explode('_', $new_material_info);
103  if (!isset($new_material_arr[1]) or !$new_material_arr[1]) {
104  $ilLog->write(__METHOD__ . ': No mapping found for chapter: ' . $material_obj_id);
105  continue;
106  }
107  $new_obj_id = $new_material_arr[1];
108  $ilLog->write(__METHOD__ . ': New material id is: ' . $new_obj_id);
109  } else {
110  #$ilLog->write(__METHOD__.': 7');
111  // Any type
112  $new_obj_id = $ilObjDataCache->lookupObjId($mappings[$material_ref_id]);
113  }
114 
115  #$ilLog->write(__METHOD__.': 8');
116  $new_material = new ilCourseObjectiveMaterials($a_new_objective);
117  #$ilLog->write(__METHOD__.': 8.1');
118  $new_material->setLMRefId($new_ref_id);
119  #$ilLog->write(__METHOD__.': 8.2');
120  $new_material->setLMObjId($new_obj_id);
121  #$ilLog->write(__METHOD__.': 8.3');
122  $new_material->setType($material['type']);
123  #$ilLog->write(__METHOD__.': 8.4');
124  $new_material->add();
125  #$ilLog->write(__METHOD__.': 9');
126  }
127  }
class ilCourseObjectiveMaterials
static _getInstance($a_copy_id)
Get instance of copy wizard options.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ delete()

ilCourseObjectiveMaterials::delete (   $lm_id)

Definition at line 378 of file class.ilCourseObjectiveMaterials.php.

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

379  {
380  global $DIC;
381 
382  $ilDB = $DIC['ilDB'];
383 
384  if (!$lm_id) {
385  return false;
386  }
387 
388  $query = "DELETE FROM crs_objective_lm " .
389  "WHERE lm_ass_id = " . $ilDB->quote($lm_id, 'integer') . " ";
390  $res = $ilDB->manipulate($query);
391 
392  return true;
393  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB

◆ deleteAll()

ilCourseObjectiveMaterials::deleteAll ( )

Definition at line 415 of file class.ilCourseObjectiveMaterials.php.

References $DIC, $ilDB, $query, $res, and getObjectiveId().

416  {
417  global $DIC;
418 
419  $ilDB = $DIC['ilDB'];
420 
421  $query = "DELETE FROM crs_objective_lm " .
422  "WHERE objective_id = " . $ilDB->quote($this->getObjectiveId(), 'integer') . " ";
423  $res = $ilDB->manipulate($query);
424  return true;
425  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ deleteMaterial()

ilCourseObjectiveMaterials::deleteMaterial ( int  $ref_id,
int  $obj_id 
)

Definition at line 395 of file class.ilCourseObjectiveMaterials.php.

References $query, and getObjectiveId().

395  : bool
396  {
397  $query = "DELETE FROM crs_objective_lm " .
398  "WHERE objective_id = " . $this->db->quote($this->getObjectiveId(), 'integer') . " " .
399  "AND ref_id = " . $this->db->quote($ref_id, 'integer') . " " .
400  "AND obj_id = " . $this->db->quote($obj_id, 'integer');
401  $this->db->manipulate($query);
402  return true;
403  }
$query
+ Here is the call graph for this function:

◆ getChapters()

ilCourseObjectiveMaterials::getChapters ( )

Definition at line 236 of file class.ilCourseObjectiveMaterials.php.

237  {
238  foreach ($this->lms as $lm_data) {
239  if ($lm_data['type'] == 'st') {
240  $chapters[] = $lm_data;
241  }
242  if ($lm_data['type'] == 'pg') {
243  $chapters[] = $lm_data;
244  }
245  }
246  return $chapters ? $chapters : array();
247  }

◆ getLM()

ilCourseObjectiveMaterials::getLM (   $lm_id)

Definition at line 249 of file class.ilCourseObjectiveMaterials.php.

250  {
251  return $this->lms[$lm_id] ? $this->lms[$lm_id] : array();
252  }

◆ getLMObjId()

ilCourseObjectiveMaterials::getLMObjId ( )

Definition at line 271 of file class.ilCourseObjectiveMaterials.php.

Referenced by add(), and checkExists().

272  {
273  return $this->lm_obj_id ? $this->lm_obj_id : 0;
274  }
+ Here is the caller graph for this function:

◆ getLMRefId()

ilCourseObjectiveMaterials::getLMRefId ( )

Definition at line 263 of file class.ilCourseObjectiveMaterials.php.

Referenced by add(), and checkExists().

264  {
265  return $this->lm_ref_id ? $this->lm_ref_id : 0;
266  }
+ Here is the caller graph for this function:

◆ getMaterials()

ilCourseObjectiveMaterials::getMaterials ( )

Definition at line 231 of file class.ilCourseObjectiveMaterials.php.

Referenced by cloneDependencies(), and toXml().

232  {
233  return $this->lms ? $this->lms : array();
234  }
+ Here is the caller graph for this function:

◆ getObjectiveId()

ilCourseObjectiveMaterials::getObjectiveId ( )

Definition at line 254 of file class.ilCourseObjectiveMaterials.php.

References $objective_id.

Referenced by __read(), add(), checkExists(), deleteAll(), deleteMaterial(), isAssigned(), isChapterAssigned(), isMaterialAssigned(), and writePosition().

+ Here is the caller graph for this function:

◆ getType()

ilCourseObjectiveMaterials::getType ( )

Definition at line 279 of file class.ilCourseObjectiveMaterials.php.

References $type.

Referenced by add().

280  {
281  return $this->type;
282  }
$type
+ Here is the caller graph for this function:

◆ isAssigned()

ilCourseObjectiveMaterials::isAssigned (   $a_ref_id,
  $a_get_id = false 
)

Check if material is assigned.

public

Parameters
intref id
Returns
bool

Definition at line 292 of file class.ilCourseObjectiveMaterials.php.

References $DIC, $ilDB, $query, $res, and getObjectiveId().

293  {
294  global $DIC;
295 
296  $ilDB = $DIC['ilDB'];
297 
298  $query = "SELECT * FROM crs_objective_lm " .
299  "WHERE ref_id = " . $this->db->quote($a_ref_id, 'integer') . " " .
300  "AND objective_id = " . $this->db->quote($this->getObjectiveId(), 'integer') . " " .
301  "AND type != 'st' AND type != 'pg' ";
302  $res = $this->db->query($query);
303 
304  // begin-patch lok
305  if (!$a_get_id) {
306  return $res->numRows() ? true : false;
307  } else {
308  $row = $this->db->fetchAssoc($res);
309  return $row["lm_ass_id"];
310  }
311  // end-patch lok
312  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ isChapterAssigned()

ilCourseObjectiveMaterials::isChapterAssigned (   $a_ref_id,
  $a_obj_id 
)

Check if chapter is assigned.

public

Parameters
intref id
Returns
bool

Definition at line 322 of file class.ilCourseObjectiveMaterials.php.

References $DIC, $ilDB, $query, $res, and getObjectiveId().

323  {
324  global $DIC;
325 
326  $ilDB = $DIC['ilDB'];
327 
328  $query = "SELECT * FROM crs_objective_lm " .
329  "WHERE ref_id = " . $this->db->quote($a_ref_id, 'integer') . " " .
330  "AND obj_id = " . $this->db->quote($a_obj_id, 'integer') . " " .
331  "AND objective_id = " . $this->db->quote($this->getObjectiveId(), 'integer') . " " .
332  "AND (type = 'st' OR type = 'pg')";
333  $res = $this->db->query($query);
334  return $res->numRows() ? true : false;
335  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

◆ isMaterialAssigned()

ilCourseObjectiveMaterials::isMaterialAssigned ( int  $ref_id,
int  $obj_id 
)

Definition at line 405 of file class.ilCourseObjectiveMaterials.php.

References $query, $res, and getObjectiveId().

405  : bool
406  {
407  $query = "SELECT * FROM crs_objective_lm " .
408  "WHERE ref_id = " . $this->db->quote($ref_id, 'integer') . " " .
409  "AND obj_id = " . $this->db->quote($obj_id, 'integer') . " " .
410  "AND objective_id = " . $this->db->quote($this->getObjectiveId(), 'integer') . " ";
411  $res = $this->db->query($query);
412  return (bool) $res->numRows();
413  }
foreach($_POST as $key=> $value) $res
$query
+ Here is the call graph for this function:

◆ setLMObjId()

ilCourseObjectiveMaterials::setLMObjId (   $a_obj_id)

Definition at line 267 of file class.ilCourseObjectiveMaterials.php.

268  {
269  $this->lm_obj_id = $a_obj_id;
270  }

◆ setLMRefId()

ilCourseObjectiveMaterials::setLMRefId (   $a_ref_id)

Definition at line 259 of file class.ilCourseObjectiveMaterials.php.

260  {
261  $this->lm_ref_id = $a_ref_id;
262  }

◆ setType()

ilCourseObjectiveMaterials::setType (   $a_type)

Definition at line 275 of file class.ilCourseObjectiveMaterials.php.

276  {
277  $this->type = $a_type;
278  }

◆ toXml()

ilCourseObjectiveMaterials::toXml ( ilXmlWriter  $writer)
Parameters
ilXmlWriter$writer

Definition at line 506 of file class.ilCourseObjectiveMaterials.php.

References getMaterials(), and ilXmlWriter\xmlElement().

507  {
508  foreach ($this->getMaterials() as $material) {
509  $writer->xmlElement(
510  'Material',
511  array(
512  'refId' => $material['ref_id'],
513  'objId' => $material['obj_id'],
514  'type' => $material['type'],
515  'position' => $material['position']
516  )
517  );
518  }
519  return true;
520  }
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:

◆ writePosition()

ilCourseObjectiveMaterials::writePosition (   $a_ass_id,
  $a_position 
)

write position

public

Parameters
intnew position
Returns

Definition at line 436 of file class.ilCourseObjectiveMaterials.php.

References $DIC, $ilDB, $query, $res, and getObjectiveId().

437  {
438  global $DIC;
439 
440  $ilDB = $DIC['ilDB'];
441 
442  $query = "UPDATE crs_objective_lm " .
443  "SET position = " . $this->db->quote((string) $a_position, 'integer') . " " .
444  "WHERE objective_id = " . $this->db->quote($this->getObjectiveId(), 'integer') . " " .
445  "AND lm_ass_id = " . $ilDB->quote($a_ass_id, "integer");
446  $res = $ilDB->manipulate($query);
447  }
foreach($_POST as $key=> $value) $res
global $DIC
Definition: goto.php:24
$query
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilCourseObjectiveMaterials::$db = null

Definition at line 35 of file class.ilCourseObjectiveMaterials.php.

◆ $lms

ilCourseObjectiveMaterials::$lms

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

◆ $objective_id

ilCourseObjectiveMaterials::$objective_id = null

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

Referenced by getObjectiveId().


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