ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAdvancedMDRecordScope Class Reference

Scope restrictions for advanced md records. More...

+ Collaboration diagram for ilAdvancedMDRecordScope:

Public Member Functions

 __construct ($a_scope_id=0)
 Constructor. More...
 
 setRecordId ($a_record_id)
 
 getRecordId ()
 
 setScopeId ($a_scope_id)
 
 getScopeId ()
 
 setRefId ($a_ref_id)
 
 getRefId ()
 
 save ()
 
 update ()
 
 delete ()
 Delete one entry. More...
 

Static Public Member Functions

static deleteByRecordI ($a_record_id)
 delete by record id More...
 

Protected Member Functions

 read ()
 Read from db. More...
 

Private Attributes

 $db
 
 $entry_exists = false
 
 $scope_id
 
 $record_id
 
 $ref_id
 
 $logger = null
 

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 (   $a_scope_id = 0)

Constructor.

Parameters
integer$a_scope_id

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

References $GLOBALS, and read().

35  {
36  $this->db = $GLOBALS['DIC']->database();
37  $this->logger = $GLOBALS['DIC']->logger()->amet();
38 
39  $this->scope_id = $a_scope_id;
40  $this->read();
41  }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilAdvancedMDRecordScope::delete ( )

Delete one entry.

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

References $query.

105  {
106  $query = 'DELETE FROM adv_md_record_scope ' .
107  'WHERE scope_id = ' . $this->db->quote($this->scope_id, 'integer');
108  $this->db->manipulate($query);
109  $this->entry_exists = false;
110  return true;
111  }
$query

◆ deleteByRecordI()

static ilAdvancedMDRecordScope::deleteByRecordI (   $a_record_id)
static

delete by record id

Parameters
int$a_record_idRecord id

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

References $db, $GLOBALS, and $query.

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

118  {
119  $db = $GLOBALS['DIC']->database();
120 
121  $query = 'DELETE FROM adv_md_record_scope ' .
122  'WHERE record_id = ' . $db->quote($a_record_id, 'integer');
123  $db->manipulate($query);
124  }
$query
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the caller graph for this function:

◆ getRecordId()

ilAdvancedMDRecordScope::getRecordId ( )

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

References $record_id.

◆ getRefId()

ilAdvancedMDRecordScope::getRefId ( )

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

References $ref_id.

◆ getScopeId()

ilAdvancedMDRecordScope::getScopeId ( )

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

References $scope_id.

◆ read()

ilAdvancedMDRecordScope::read ( )
protected

Read from db.

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

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

Referenced by __construct().

131  {
132  if (!$this->scope_id) {
133  return;
134  }
135  $query = 'SELECT * FROM adv_md_record_scope ' .
136  'WHERE scope_id = ' . $this->db->quote($this->scope_id, 'integer');
137  $res = $this->db->query($query);
138  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
139  $this->entry_exists = true;
140  $this->record_id = $row->record_id;
141  $this->ref_id = $row->ref_id;
142  }
143  }
foreach($_POST as $key=> $value) $res
$query
$row
+ Here is the caller graph for this function:

◆ save()

ilAdvancedMDRecordScope::save ( )

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

References $query.

75  {
76  $this->logger->debug('Create new entry.');
77  // create
78  $this->scope_id = $this->db->nextId('adv_md_record_scope');
79  $query = 'INSERT INTO adv_md_record_scope (scope_id, record_id, ref_id) ' .
80  'VALUES ( ' .
81  $this->db->quote($this->scope_id, 'integer') . ', ' .
82  $this->db->quote($this->record_id, 'integer') . ', ' .
83  $this->db->quote($this->ref_id, 'integer') .
84  ')';
85  $this->db->manipulate($query);
86  $this->entry_exists = true;
87  }
$query

◆ setRecordId()

ilAdvancedMDRecordScope::setRecordId (   $a_record_id)

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

44  {
45  $this->record_id = $a_record_id;
46  }

◆ setRefId()

ilAdvancedMDRecordScope::setRefId (   $a_ref_id)

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

64  {
65  $this->ref_id = $a_ref_id;
66  }

◆ setScopeId()

ilAdvancedMDRecordScope::setScopeId (   $a_scope_id)

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

54  {
55  $this->scope_id = $a_scope_id;
56  }

◆ update()

ilAdvancedMDRecordScope::update ( )

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

References $query.

90  {
91  $this->logger->debug('Update entry.');
92  // update (update of record ids not supported)
93  $query = 'UPDATE adv_md_record_scope ' .
94  'SET ref_id = ' . $this->db->quote($this->ref_id, 'integer') . ' ' .
95  'WHERE scope_id = ' . $this->db->quote($this->scope_id, 'integer');
96  $this->db->manipulate($query);
97  }
$query

Field Documentation

◆ $db

ilAdvancedMDRecordScope::$db
private

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

Referenced by deleteByRecordI().

◆ $entry_exists

ilAdvancedMDRecordScope::$entry_exists = false
private

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

◆ $logger

ilAdvancedMDRecordScope::$logger = null
private

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

◆ $record_id

ilAdvancedMDRecordScope::$record_id
private

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

Referenced by getRecordId().

◆ $ref_id

ilAdvancedMDRecordScope::$ref_id
private

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

Referenced by getRefId().

◆ $scope_id

ilAdvancedMDRecordScope::$scope_id
private

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

Referenced by getScopeId().


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