ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilOrgUnitObjectPositionSetting Class Reference

Stores object activation status of orgunit position settings. More...

+ Collaboration diagram for ilOrgUnitObjectPositionSetting:

Public Member Functions

 __construct ($a_obj_id)
 Constructor. More...
 
 lookupActive ($a_obj_id)
 Lookup activation status. More...
 
 isActive ()
 Check if position access is active. More...
 
 setActive ($a_status)
 Set active for object. More...
 
 update ()
 Update object entry. More...
 
 delete ()
 Delete record. More...
 
 hasObjectSpecificActivation ()
 

Protected Member Functions

 readSettings ()
 Read from db. More...
 

Protected Attributes

 $db
 

Private Attributes

 $obj_id
 
 $active
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitObjectPositionSetting::__construct (   $a_obj_id)

Constructor.

Parameters
int$a_obj_id

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

References $GLOBALS, and readSettings().

34  {
35  $this->db = $GLOBALS['DIC']->database();
36  $this->obj_id = $a_obj_id;
37  $this->readSettings();
38  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilOrgUnitObjectPositionSetting::delete ( )

Delete record.

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

References $query.

100  {
101  $query = 'DELETE from orgu_obj_pos_settings ' . 'WHERE obj_id = '
102  . $this->db->quote($this->obj_id, 'integer');
103  $this->db->manipulate($query);
104  }
$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 111 of file class.ilOrgUnitObjectPositionSetting.php.

112  {
113  return $this->active !== null;
114  }

◆ 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.

Returns
null|bool

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

References $active.

Referenced by update().

+ Here is the caller graph for this function:

◆ lookupActive()

ilOrgUnitObjectPositionSetting::lookupActive (   $a_obj_id)

Lookup activation status.

Parameters
int$a_obj_id
Returns
bool active status

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

References $db, $GLOBALS, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

49  {
50  $db = $GLOBALS['DIC']->database();
51 
52  $query = 'select * from orgu_obj_pos_settings ' . 'where obj_id = '
53  . $db->quote($a_obj_id, 'integer');
54  $res = $this->db->query($query);
55  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
56  return (bool) $row->active;
57  }
58  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res
$query

◆ readSettings()

ilOrgUnitObjectPositionSetting::readSettings ( )
protected

Read from db.

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

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

Referenced by __construct().

121  {
122  if (!$this->obj_id) {
123  return;
124  }
125  $query = 'select * from orgu_obj_pos_settings ' . 'where obj_id = '
126  . $this->db->quote($this->obj_id, 'integer');
127  $res = $this->db->query($query);
128  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
129  $this->active = (bool) $row->active;
130  }
131 
132  return;
133  }
foreach($_POST as $key=> $value) $res
$query
+ Here is the caller graph for this function:

◆ setActive()

ilOrgUnitObjectPositionSetting::setActive (   $a_status)

Set active for object.

Parameters
bool$a_status

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

78  {
79  $this->active = $a_status;
80  }

◆ update()

ilOrgUnitObjectPositionSetting::update ( )

Update object entry.

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

References isActive().

87  {
88  $this->db->replace('orgu_obj_pos_settings', [
89  'obj_id' => [ 'integer', $this->obj_id ],
90  ], [
91  'active' => [ 'integer', (int) $this->isActive() ],
92  ]);
93  }
isActive()
Check if position access is active.
+ Here is the call graph for this function:

Field Documentation

◆ $active

ilOrgUnitObjectPositionSetting::$active
private

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

Referenced by isActive().

◆ $db

ilOrgUnitObjectPositionSetting::$db
protected

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

Referenced by lookupActive().

◆ $obj_id

ilOrgUnitObjectPositionSetting::$obj_id
private

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


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