ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilAdvancedMDRecordScope.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
11
class
ilAdvancedMDRecordScope
12
{
16
private
$db
;
17
18
private
$entry_exists
=
false
;
19
20
private
$scope_id
;
21
private
$record_id
;
22
private
$ref_id
;
23
24
28
private
$logger
= null;
29
34
public
function
__construct
($a_scope_id = 0)
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
}
42
43
public
function
setRecordId
($a_record_id)
44
{
45
$this->record_id = $a_record_id;
46
}
47
48
public
function
getRecordId
()
49
{
50
return
$this->record_id
;
51
}
52
53
public
function
setScopeId
($a_scope_id)
54
{
55
$this->scope_id = $a_scope_id;
56
}
57
58
public
function
getScopeId
()
59
{
60
return
$this->scope_id
;
61
}
62
63
public
function
setRefId
($a_ref_id)
64
{
65
$this->ref_id = $a_ref_id;
66
}
67
68
public
function
getRefId
()
69
{
70
return
$this->ref_id
;
71
}
72
73
74
public
function
save
()
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
}
88
89
public
function
update
()
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
}
98
99
100
104
public
function
delete
()
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
}
112
117
public
static
function
deleteByRecordI
($a_record_id)
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
}
125
126
130
protected
function
read
()
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
}
144
}
ilAdvancedMDRecordScope
Scope restrictions for advanced md records.
Definition:
class.ilAdvancedMDRecordScope.php:11
ilAdvancedMDRecordScope\deleteByRecordI
static deleteByRecordI($a_record_id)
delete by record id
Definition:
class.ilAdvancedMDRecordScope.php:117
ilAdvancedMDRecordScope\setScopeId
setScopeId($a_scope_id)
Definition:
class.ilAdvancedMDRecordScope.php:53
ilAdvancedMDRecordScope\$ref_id
$ref_id
Definition:
class.ilAdvancedMDRecordScope.php:22
ilAdvancedMDRecordScope\$scope_id
$scope_id
Definition:
class.ilAdvancedMDRecordScope.php:20
ilAdvancedMDRecordScope\getScopeId
getScopeId()
Definition:
class.ilAdvancedMDRecordScope.php:58
ilAdvancedMDRecordScope\setRefId
setRefId($a_ref_id)
Definition:
class.ilAdvancedMDRecordScope.php:63
ilAdvancedMDRecordScope\read
read()
Read from db.
Definition:
class.ilAdvancedMDRecordScope.php:130
$GLOBALS
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Definition:
generate-standalone.php:18
ilAdvancedMDRecordScope\$record_id
$record_id
Definition:
class.ilAdvancedMDRecordScope.php:21
ilAdvancedMDRecordScope\$entry_exists
$entry_exists
Definition:
class.ilAdvancedMDRecordScope.php:18
ilAdvancedMDRecordScope\$db
$db
Definition:
class.ilAdvancedMDRecordScope.php:16
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilAdvancedMDRecordScope\__construct
__construct($a_scope_id=0)
Constructor.
Definition:
class.ilAdvancedMDRecordScope.php:34
$query
$query
Definition:
proxy_ylocal.php:13
ilAdvancedMDRecordScope\update
update()
Definition:
class.ilAdvancedMDRecordScope.php:89
ilAdvancedMDRecordScope\getRefId
getRefId()
Definition:
class.ilAdvancedMDRecordScope.php:68
ilAdvancedMDRecordScope\setRecordId
setRecordId($a_record_id)
Definition:
class.ilAdvancedMDRecordScope.php:43
ilAdvancedMDRecordScope\getRecordId
getRecordId()
Definition:
class.ilAdvancedMDRecordScope.php:48
ilAdvancedMDRecordScope\save
save()
Definition:
class.ilAdvancedMDRecordScope.php:74
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilAdvancedMDRecordScope\$logger
$logger
Definition:
class.ilAdvancedMDRecordScope.php:28
$row
$row
Definition:
10autofilter-selection-1.php:74
Services
AdvancedMetaData
classes
class.ilAdvancedMDRecordScope.php
Generated on Sat Jan 18 2025 19:01:26 for ILIAS by
1.8.13 (using
Doxyfile
)