ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 26 of file class.ilOrgUnitObjectPositionSetting.php.

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitObjectPositionSetting::__construct ( int  $a_obj_id)

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

References $GLOBALS, and readSettings().

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

Member Function Documentation

◆ delete()

ilOrgUnitObjectPositionSetting::delete ( )

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

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

◆ 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 90 of file class.ilOrgUnitObjectPositionSetting.php.

90  : bool
91  {
92  return $this->active !== null;
93  }

◆ 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 57 of file class.ilOrgUnitObjectPositionSetting.php.

References $active.

Referenced by update().

57  : ?bool
58  {
59  return $this->active;
60  }
+ Here is the caller graph for this function:

◆ lookupActive()

ilOrgUnitObjectPositionSetting::lookupActive ( int  $a_obj_id)

Lookup activation status.

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

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

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

◆ readSettings()

ilOrgUnitObjectPositionSetting::readSettings ( )
private

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

References $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by __construct().

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

◆ setActive()

ilOrgUnitObjectPositionSetting::setActive ( bool  $a_status)

Set active for object.

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

Referenced by ilObjExercise\saveData().

65  : void
66  {
67  $this->active = $a_status;
68  }
+ Here is the caller graph for this function:

◆ update()

ilOrgUnitObjectPositionSetting::update ( )

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

References isActive().

70  : void
71  {
72  $this->db->replace('orgu_obj_pos_settings', [
73  'obj_id' => ['integer', $this->obj_id],
74  ], [
75  'active' => ['integer', (int) $this->isActive()],
76  ]);
77  }
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 30 of file class.ilOrgUnitObjectPositionSetting.php.

Referenced by isActive().

◆ $db

ilDBInterface ilOrgUnitObjectPositionSetting::$db
protected

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

◆ $obj_id

int ilOrgUnitObjectPositionSetting::$obj_id
private

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


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