ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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 25 of file class.ilOrgUnitObjectPositionSetting.php.

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitObjectPositionSetting::__construct ( int  $a_obj_id)

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

References $GLOBALS, and readSettings().

32  {
33  $this->db = $GLOBALS['DIC']->database();
34  $this->obj_id = $a_obj_id;
35  $this->readSettings();
36  }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilOrgUnitObjectPositionSetting::delete ( )

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

References $query.

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

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

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

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

References $active.

Referenced by update().

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

◆ lookupActive()

ilOrgUnitObjectPositionSetting::lookupActive ( int  $a_obj_id)

Lookup activation status.

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

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

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

◆ readSettings()

ilOrgUnitObjectPositionSetting::readSettings ( )
private

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

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

Referenced by __construct().

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

◆ setActive()

ilOrgUnitObjectPositionSetting::setActive ( bool  $a_status)

Set active for object.

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

Referenced by ilObjExercise\saveData().

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

◆ update()

ilOrgUnitObjectPositionSetting::update ( )

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

References isActive().

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

Referenced by isActive().

◆ $db

ilDBInterface ilOrgUnitObjectPositionSetting::$db
protected

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

◆ $obj_id

int ilOrgUnitObjectPositionSetting::$obj_id
private

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


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