ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAdvancedMDRecordScope Class Reference

Scope restrictions for advanced md records. More...

+ Collaboration diagram for ilAdvancedMDRecordScope:

Public Member Functions

 __construct (int $a_scope_id=0)
 
 setRecordId (int $a_record_id)
 
 getRecordId ()
 
 setScopeId (int $a_scope_id)
 
 getScopeId ()
 
 setRefId (int $a_ref_id)
 
 getRefId ()
 
 save ()
 
 update ()
 
 delete ()
 

Static Public Member Functions

static deleteByRecordId (int $a_record_id)
 

Protected Member Functions

 read ()
 

Protected Attributes

ilDBInterface $db
 
ilLogger $logger
 

Private Attributes

int $scope_id
 
int $record_id
 
int $ref_id
 

Detailed Description

Scope restrictions for advanced md records.

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.ilAdvancedMDRecordScope.php.

Constructor & Destructor Documentation

◆ __construct()

ilAdvancedMDRecordScope::__construct ( int  $a_scope_id = 0)

PhpUndefinedMethodInspection

Definition at line 20 of file class.ilAdvancedMDRecordScope.php.

References $DIC, ILIAS\Repository\logger(), and read().

21  {
22  global $DIC;
23 
24  $this->db = $DIC->database();
26  $this->logger = $DIC->logger()->amet();
27 
28  $this->scope_id = $a_scope_id;
29  $this->read();
30  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilAdvancedMDRecordScope::delete ( )

Definition at line 85 of file class.ilAdvancedMDRecordScope.php.

References $query.

85  : void
86  {
87  $query = 'DELETE FROM adv_md_record_scope ' .
88  'WHERE scope_id = ' . $this->db->quote($this->scope_id, 'integer');
89  $this->db->manipulate($query);
90  }
$query

◆ deleteByRecordId()

static ilAdvancedMDRecordScope::deleteByRecordId ( int  $a_record_id)
static

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

References $DIC, $query, ilDBInterface\manipulate(), and ilDBInterface\quote().

Referenced by ilAdvancedMDRecord\delete(), and ilAdvancedMDRecord\update().

92  : void
93  {
94  global $DIC;
95  $db = $DIC->database();
96 
97  $query = 'DELETE FROM adv_md_record_scope ' .
98  'WHERE record_id = ' . $db->quote($a_record_id, 'integer');
100  }
quote($value, string $type)
global $DIC
Definition: feed.php:28
$query
manipulate(string $query)
Run a (write) Query on the database.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRecordId()

ilAdvancedMDRecordScope::getRecordId ( )

Definition at line 37 of file class.ilAdvancedMDRecordScope.php.

References $record_id.

37  : int
38  {
39  return $this->record_id;
40  }

◆ getRefId()

ilAdvancedMDRecordScope::getRefId ( )

Definition at line 57 of file class.ilAdvancedMDRecordScope.php.

References $ref_id.

57  : int
58  {
59  return $this->ref_id;
60  }

◆ getScopeId()

ilAdvancedMDRecordScope::getScopeId ( )

Definition at line 47 of file class.ilAdvancedMDRecordScope.php.

References $scope_id.

47  : int
48  {
49  return $this->scope_id;
50  }

◆ read()

ilAdvancedMDRecordScope::read ( )
protected

Definition at line 102 of file class.ilAdvancedMDRecordScope.php.

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

Referenced by __construct().

102  : void
103  {
104  if (!$this->scope_id) {
105  return;
106  }
107  $query = 'SELECT * FROM adv_md_record_scope ' .
108  'WHERE scope_id = ' . $this->db->quote($this->scope_id, 'integer');
109  $res = $this->db->query($query);
110  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
111  $this->record_id = (int) $row->record_id;
112  $this->ref_id = (int) $row->ref_id;
113  }
114  }
$res
Definition: ltiservices.php:69
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilAdvancedMDRecordScope::save ( )

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

References $query.

62  : void
63  {
64  // create
65  $this->scope_id = $this->db->nextId('adv_md_record_scope');
66  $query = 'INSERT INTO adv_md_record_scope (scope_id, record_id, ref_id) ' .
67  'VALUES ( ' .
68  $this->db->quote($this->scope_id, 'integer') . ', ' .
69  $this->db->quote($this->record_id, 'integer') . ', ' .
70  $this->db->quote($this->ref_id, 'integer') .
71  ')';
72  $this->db->manipulate($query);
73  }
$query

◆ setRecordId()

ilAdvancedMDRecordScope::setRecordId ( int  $a_record_id)

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

32  : void
33  {
34  $this->record_id = $a_record_id;
35  }

◆ setRefId()

ilAdvancedMDRecordScope::setRefId ( int  $a_ref_id)

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

52  : void
53  {
54  $this->ref_id = $a_ref_id;
55  }

◆ setScopeId()

ilAdvancedMDRecordScope::setScopeId ( int  $a_scope_id)

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

42  : void
43  {
44  $this->scope_id = $a_scope_id;
45  }

◆ update()

ilAdvancedMDRecordScope::update ( )

Definition at line 75 of file class.ilAdvancedMDRecordScope.php.

References $query, and ILIAS\Repository\logger().

75  : void
76  {
77  $this->logger->debug('Update entry.');
78  // update (update of record ids not supported)
79  $query = 'UPDATE adv_md_record_scope ' .
80  'SET ref_id = ' . $this->db->quote($this->ref_id, 'integer') . ' ' .
81  'WHERE scope_id = ' . $this->db->quote($this->scope_id, 'integer');
82  $this->db->manipulate($query);
83  }
$query
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilAdvancedMDRecordScope::$db
protected

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

◆ $logger

ilLogger ilAdvancedMDRecordScope::$logger
protected

Definition at line 18 of file class.ilAdvancedMDRecordScope.php.

◆ $record_id

int ilAdvancedMDRecordScope::$record_id
private

Definition at line 14 of file class.ilAdvancedMDRecordScope.php.

Referenced by getRecordId().

◆ $ref_id

int ilAdvancedMDRecordScope::$ref_id
private

Definition at line 15 of file class.ilAdvancedMDRecordScope.php.

Referenced by getRefId().

◆ $scope_id

int ilAdvancedMDRecordScope::$scope_id
private

Definition at line 13 of file class.ilAdvancedMDRecordScope.php.

Referenced by getScopeId().


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