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

Object settings regarding position permissions. More...

+ Collaboration diagram for ilOrgUnitObjectTypePositionSetting:

Public Member Functions

 __construct ($a_obj_type)
 Constructor. More...
 
 setActive ($a_active)
 set active for object type More...
 
 setActivationDefault ($a_default)
 
 setChangeableForObject ($a_status)
 
 isActive ()
 Check if active. More...
 
 getActivationDefault ()
 Get activation default. More...
 
 isChangeableForObject ()
 return bool More...
 
 update ()
 Update type entry. More...
 
 getType ()
 

Data Fields

const DEFAULT_OFF = 0
 
const DEFAULT_ON = 1
 

Protected Member Functions

 read ()
 Read from db. More...
 

Protected Attributes

 $db
 

Private Attributes

 $type = ''
 
 $active = false
 
 $changeable = false
 
 $default = self::DEFAULT_OFF
 

Detailed Description

Object settings regarding position permissions.

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

Definition at line 10 of file class.ilOrgUnitObjectTypePositionSetting.php.

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitObjectTypePositionSetting::__construct (   $a_obj_type)

Constructor.

Parameters
string$a_obj_type

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

References $GLOBALS, and read().

42  {
43  $this->db = $GLOBALS['DIC']->database();
44  $this->type = $a_obj_type;
45  $this->read();
46  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the call graph for this function:

Member Function Documentation

◆ getActivationDefault()

ilOrgUnitObjectTypePositionSetting::getActivationDefault ( )

Get activation default.

Returns
int

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

References $default.

Referenced by update().

+ Here is the caller graph for this function:

◆ getType()

ilOrgUnitObjectTypePositionSetting::getType ( )
Returns
string

Definition at line 142 of file class.ilOrgUnitObjectTypePositionSetting.php.

References $type.

◆ isActive()

ilOrgUnitObjectTypePositionSetting::isActive ( )

Check if active.

Returns
bool

Definition at line 81 of file class.ilOrgUnitObjectTypePositionSetting.php.

References $active.

Referenced by update().

+ Here is the caller graph for this function:

◆ isChangeableForObject()

ilOrgUnitObjectTypePositionSetting::isChangeableForObject ( )

return bool

Definition at line 101 of file class.ilOrgUnitObjectTypePositionSetting.php.

References $changeable.

Referenced by update().

+ Here is the caller graph for this function:

◆ read()

ilOrgUnitObjectTypePositionSetting::read ( )
protected

Read from db.

Definition at line 125 of file class.ilOrgUnitObjectTypePositionSetting.php.

References $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, setActivationDefault(), setActive(), and setChangeableForObject().

Referenced by __construct().

126  {
127  $query = 'SELECT * FROM orgu_obj_type_settings ' . 'WHERE obj_type = '
128  . $this->db->quote($this->type, 'text');
129  $res = $this->db->query($query);
130  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
131  $this->entry_exists = true;
132  $this->setActive((bool) $row->active);
133  $this->setActivationDefault((int) $row->activation_default);
134  $this->setChangeableForObject((bool) $row->changeable);
135  }
136  }
foreach($_POST as $key=> $value) $res
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setActivationDefault()

ilOrgUnitObjectTypePositionSetting::setActivationDefault (   $a_default)
Parameters
int$a_default

Definition at line 61 of file class.ilOrgUnitObjectTypePositionSetting.php.

Referenced by read().

62  {
63  $this->default = $a_default;
64  }
+ Here is the caller graph for this function:

◆ setActive()

ilOrgUnitObjectTypePositionSetting::setActive (   $a_active)

set active for object type

Definition at line 52 of file class.ilOrgUnitObjectTypePositionSetting.php.

Referenced by read().

53  {
54  $this->active = $a_active;
55  }
+ Here is the caller graph for this function:

◆ setChangeableForObject()

ilOrgUnitObjectTypePositionSetting::setChangeableForObject (   $a_status)
Parameters
bool$a_status

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

Referenced by read().

71  {
72  $this->changeable = $a_status;
73  }
+ Here is the caller graph for this function:

◆ update()

ilOrgUnitObjectTypePositionSetting::update ( )

Update type entry.

Definition at line 110 of file class.ilOrgUnitObjectTypePositionSetting.php.

References getActivationDefault(), isActive(), and isChangeableForObject().

111  {
112  $this->db->replace('orgu_obj_type_settings', [
113  'obj_type' => [ 'text', $this->type ],
114  ], [
115  'active' => [ 'integer', (int) $this->isActive() ],
116  'activation_default' => [ 'integer', (int) $this->getActivationDefault() ],
117  'changeable' => [ 'integer', (int) $this->isChangeableForObject() ],
118  ]);
119  }
+ Here is the call graph for this function:

Field Documentation

◆ $active

ilOrgUnitObjectTypePositionSetting::$active = false
private

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

Referenced by isActive().

◆ $changeable

ilOrgUnitObjectTypePositionSetting::$changeable = false
private

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

Referenced by isChangeableForObject().

◆ $db

ilOrgUnitObjectTypePositionSetting::$db
protected

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

◆ $default

ilOrgUnitObjectTypePositionSetting::$default = self::DEFAULT_OFF
private

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

Referenced by getActivationDefault().

◆ $type

ilOrgUnitObjectTypePositionSetting::$type = ''
private

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

Referenced by getType().

◆ DEFAULT_OFF

const ilOrgUnitObjectTypePositionSetting::DEFAULT_OFF = 0

Definition at line 12 of file class.ilOrgUnitObjectTypePositionSetting.php.

◆ DEFAULT_ON

const ilOrgUnitObjectTypePositionSetting::DEFAULT_ON = 1

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