ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilOrgUnitObjectPositionSetting Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilOrgUnitObjectPositionSetting:

Public Member Functions

 __construct (int $a_obj_id)
 
 lookupActive (int $a_obj_id)
 Lookup activation status. More...
 
 isActive ()
 Check if position access is active. More...
 
 setActive (bool $a_status)
 Set active for object. More...
 
 update ()
 
 delete ()
 
 hasObjectSpecificActivation ()
 

Protected Attributes

ilDBInterface $db
 

Private Member Functions

 readSettings ()
 

Private Attributes

int $obj_id
 
bool $active = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Stores object activation status of orgunit position settings.

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

Definition at line 23 of file class.ilOrgUnitObjectPositionSetting.php.

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitObjectPositionSetting::__construct ( int  $a_obj_id)

Definition at line 29 of file class.ilOrgUnitObjectPositionSetting.php.

References $GLOBALS, and readSettings().

30  {
31  $this->db = $GLOBALS['DIC']->database();
32  $this->obj_id = $a_obj_id;
33  $this->readSettings();
34  }
$GLOBALS["DIC"]
Definition: wac.php:53
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilOrgUnitObjectPositionSetting::delete ( )

Definition at line 76 of file class.ilOrgUnitObjectPositionSetting.php.

76  : void
77  {
78  $query = 'DELETE from orgu_obj_pos_settings ' . 'WHERE obj_id = '
79  . $this->db->quote($this->obj_id, 'integer');
80  $this->db->manipulate($query);
81  }

◆ hasObjectSpecificActivation()

ilOrgUnitObjectPositionSetting::hasObjectSpecificActivation ( )
Returns
bool Returns true if the object has a specific setting false if there is no object specific setting, take the global setting in this case.

Definition at line 87 of file class.ilOrgUnitObjectPositionSetting.php.

References null.

87  : bool
88  {
89  return $this->active !== null;
90  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

◆ isActive()

ilOrgUnitObjectPositionSetting::isActive ( )

Check if position access is active.

This returns true or false if it is object specific or null if the object has no setting.

Definition at line 54 of file class.ilOrgUnitObjectPositionSetting.php.

References $active.

Referenced by update().

54  : ?bool
55  {
56  return $this->active;
57  }
+ Here is the caller graph for this function:

◆ lookupActive()

ilOrgUnitObjectPositionSetting::lookupActive ( int  $a_obj_id)

Lookup activation status.

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

References $GLOBALS, $res, ilDBConstants\FETCHMODE_OBJECT, and ilDBInterface\quote().

39  : bool
40  {
41  $db = $GLOBALS['DIC']->database();
42 
43  $query = 'select * from orgu_obj_pos_settings ' . 'where obj_id = '
44  . $db->quote($a_obj_id, 'integer');
45  $res = $this->db->query($query);
46  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
47  return (bool) $row->active;
48  }
49  }
$res
Definition: ltiservices.php:66
quote($value, string $type)
$GLOBALS["DIC"]
Definition: wac.php:53
+ Here is the call graph for this function:

◆ readSettings()

ilOrgUnitObjectPositionSetting::readSettings ( )
private

Definition at line 92 of file class.ilOrgUnitObjectPositionSetting.php.

References $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by __construct().

92  : void
93  {
94  if (!$this->obj_id) {
95  return;
96  }
97  $query = 'select * from orgu_obj_pos_settings ' . 'where obj_id = '
98  . $this->db->quote($this->obj_id, 'integer');
99  $res = $this->db->query($query);
100  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
101  $this->active = (bool) $row->active;
102  }
103 
104  return;
105  }
$res
Definition: ltiservices.php:66
+ Here is the caller graph for this function:

◆ setActive()

ilOrgUnitObjectPositionSetting::setActive ( bool  $a_status)

Set active for object.

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

Referenced by ilObjExercise\saveData().

62  : void
63  {
64  $this->active = $a_status;
65  }
+ Here is the caller graph for this function:

◆ update()

ilOrgUnitObjectPositionSetting::update ( )

Definition at line 67 of file class.ilOrgUnitObjectPositionSetting.php.

References isActive().

67  : void
68  {
69  $this->db->replace('orgu_obj_pos_settings', [
70  'obj_id' => ['integer', $this->obj_id],
71  ], [
72  'active' => ['integer', (int) $this->isActive()],
73  ]);
74  }
isActive()
Check if position access is active.
+ Here is the call graph for this function:

Field Documentation

◆ $active

bool ilOrgUnitObjectPositionSetting::$active = null
private

Definition at line 27 of file class.ilOrgUnitObjectPositionSetting.php.

Referenced by isActive().

◆ $db

ilDBInterface ilOrgUnitObjectPositionSetting::$db
protected

Definition at line 25 of file class.ilOrgUnitObjectPositionSetting.php.

◆ $obj_id

int ilOrgUnitObjectPositionSetting::$obj_id
private

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


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