ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMDRights Class Reference
+ Inheritance diagram for ilMDRights:
+ Collaboration diagram for ilMDRights:

Public Member Functions

 setCosts ($a_costs)
 
 getCosts ()
 
 setCopyrightAndOtherRestrictions ($a_caor)
 
 getCopyrightAndOtherRestrictions ()
 
 setDescription ($a_description)
 
 getDescription ()
 
 setDescriptionLanguage (&$lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 parseDescriptionFromImport ($a_description)
 
 setCosts ($a_costs)
 
 getCosts ()
 
 setCopyrightAndOtherRestrictions ($a_caor)
 
 getCopyrightAndOtherRestrictions ()
 
 setDescription ($a_description)
 
 getDescription ()
 
 setDescriptionLanguage (&$lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
 _getId ($a_rbac_id, $a_obj_id)
 
 setCosts ($a_costs)
 
 getCosts ()
 
 setCopyrightAndOtherRestrictions ($a_caor)
 
 getCopyrightAndOtherRestrictions ()
 
 setDescription ($a_description)
 
 getDescription ()
 
 setDescriptionLanguage (&$lng_obj)
 
getDescriptionLanguage ()
 
 getDescriptionLanguageCode ()
 
 save ()
 
 update ()
 
 delete ()
 
 __getFields ()
 
 read ()
 
 toXML (&$writer)
 
- Public Member Functions inherited from ilMDBase
 __construct ( $a_rbac_id=0, $a_obj_id=0, $a_type=0)
 
 setRBACId ($a_id)
 
 getRBACId ()
 
 setObjId ($a_id)
 
 getObjId ()
 
 setObjType ($a_type)
 
 getObjType ()
 
 setMetaId ($a_meta_id, $a_read_data=true)
 
 getMetaId ()
 
 setParentType ($a_parent_type)
 
 getParentType ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 setExportMode ($a_export_mode=true)
 
 getExportMode ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 
 __construct ( $a_rbac_id=0, $a_obj_id=0, $a_type=0)
 
 setRBACId ($a_id)
 
 getRBACId ()
 
 setObjId ($a_id)
 
 getObjId ()
 
 setObjType ($a_type)
 
 getObjType ()
 
 setMetaId ($a_meta_id, $a_read_data=true)
 
 getMetaId ()
 
 setParentType ($a_parent_type)
 
 getParentType ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 
 __construct ( $a_rbac_id=0, $a_obj_id=0, $a_type=0)
 
 setRBACId ($a_id)
 
 getRBACId ()
 
 setObjId ($a_id)
 
 getObjId ()
 
 setObjType ($a_type)
 
 getObjType ()
 
 setMetaId ($a_meta_id, $a_read_data=true)
 
 getMetaId ()
 
 setParentType ($a_parent_type)
 
 getParentType ()
 
 setParentId ($a_id)
 
 getParentId ()
 
 setExportMode ($a_export_mode=true)
 
 getExportMode ()
 
 validate ()
 
 update ()
 
 save ()
 
 delete ()
 
 toXML (&$writer)
 

Static Public Member Functions

static lookupRightsByTypeAndCopyright (array $a_types, array $a_copyright)
 
static _lookupDescription ($a_rbac_id, $a_obj_id)
 Lookup description (copyright) More...
 
static _getId ($a_rbac_id, $a_obj_id)
 
static _lookupDescription ($a_rbac_id, $a_obj_id)
 Lookup description (copyright) More...
 
static _getId ($a_rbac_id, $a_obj_id)
 

Additional Inherited Members

- Data Fields inherited from ilMDBase
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 
- Protected Attributes inherited from ilMDBase
 $log
 

Detailed Description

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

Member Function Documentation

◆ __getFields() [1/3]

ilMDRights::__getFields ( )

Definition at line 138 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getDescriptionLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), ilMDBase\getRBACId(), and ilUtil\prepareDBString().

139  {
140  return array('rbac_id' => $this->getRBACId(),
141  'obj_id' => $this->getObjId(),
142  'obj_type' => ilUtil::prepareDBString($this->getObjType()),
143  'costs' => ilUtil::prepareDBString($this->getCosts()),
144  'copyright_and_other_restrictions' => ilUtil::prepareDBString($this->getCopyrightAndOtherRestrictions()),
145  'description' => ilUtil::prepareDBString($this->getDescription()),
146  'description_language' => ilUtil::prepareDBString($this->getDescriptionLanguageCode()));
147  }
getCopyrightAndOtherRestrictions()
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
+ Here is the call graph for this function:

◆ __getFields() [2/3]

ilMDRights::__getFields ( )

Definition at line 143 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getDescriptionLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

144  {
145  return array('rbac_id' => array('integer',$this->getRBACId()),
146  'obj_id' => array('integer',$this->getObjId()),
147  'obj_type' => array('text',$this->getObjType()),
148  'costs' => array('text',$this->getCosts()),
149  'cpr_and_or' => array('text',$this->getCopyrightAndOtherRestrictions()),
150  'description' => array('text',$this->getDescription()),
151  'description_language' => array('text',$this->getDescriptionLanguageCode()));
152  }
getCopyrightAndOtherRestrictions()
+ Here is the call graph for this function:

◆ __getFields() [3/3]

ilMDRights::__getFields ( )

Definition at line 170 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getDescriptionLanguageCode(), ilMDBase\getObjId(), ilMDBase\getObjType(), and ilMDBase\getRBACId().

Referenced by save().

171  {
172  return array('rbac_id' => array('integer',$this->getRBACId()),
173  'obj_id' => array('integer',$this->getObjId()),
174  'obj_type' => array('text',$this->getObjType()),
175  'costs' => array('text',$this->getCosts()),
176  'cpr_and_or' => array('text',$this->getCopyrightAndOtherRestrictions()),
177  'description' => array('text',$this->getDescription()),
178  'description_language' => array('text',$this->getDescriptionLanguageCode()));
179  }
getCopyrightAndOtherRestrictions()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getId() [1/3]

ilMDRights::_getId (   $a_rbac_id,
  $a_obj_id 
)

Definition at line 190 of file class.ilMDRights.php.

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

191  {
192  global $ilDB;
193 
194  $query = "SELECT meta_rights_id FROM il_meta_rights " .
195  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id) . " " .
196  "AND obj_id = " . $ilDB->quote($a_obj_id);
197 
198  $res = $ilDB->query($query);
199  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
200  return $row->meta_rights_id;
201  }
202  return false;
203  }
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getId() [2/3]

static ilMDRights::_getId (   $a_rbac_id,
  $a_obj_id 
)
static

Definition at line 230 of file class.ilMDRights.php.

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

231  {
232  global $DIC;
233 
234  $ilDB = $DIC['ilDB'];
235 
236  $query = "SELECT meta_rights_id FROM il_meta_rights " .
237  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
238  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
239 
240  $res = $ilDB->query($query);
241  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
242  return $row->meta_rights_id;
243  }
244  return false;
245  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _getId() [3/3]

static ilMDRights::_getId (   $a_rbac_id,
  $a_obj_id 
)
static

Definition at line 273 of file class.ilMDRights.php.

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

Referenced by ilMD\getRights().

274  {
275  global $DIC;
276 
277  $ilDB = $DIC['ilDB'];
278 
279  $query = "SELECT meta_rights_id FROM il_meta_rights " .
280  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
281  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer');
282 
283  $res = $ilDB->query($query);
284  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
285  return $row->meta_rights_id;
286  }
287  return false;
288  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _lookupDescription() [1/2]

static ilMDRights::_lookupDescription (   $a_rbac_id,
  $a_obj_id 
)
static

Lookup description (copyright)

public

Parameters
intrbac_id
intobj_id

Definition at line 215 of file class.ilMDRights.php.

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

216  {
217  global $DIC;
218 
219  $ilDB = $DIC['ilDB'];
220 
221  $query = "SELECT description FROM il_meta_rights " .
222  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
223  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
224  $res = $ilDB->query($query);
226  return $row->description ? $row->description : '';
227  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB

◆ _lookupDescription() [2/2]

static ilMDRights::_lookupDescription (   $a_rbac_id,
  $a_obj_id 
)
static

Lookup description (copyright)

public

Parameters
intrbac_id
intobj_id

Definition at line 258 of file class.ilMDRights.php.

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

Referenced by ilOerHarvester\deleteDeprecated(), ilMDCopyrightSelectionGUI\fillTemplate(), and ilMDEditorGUI\listQuickEditCopyright().

259  {
260  global $DIC;
261 
262  $ilDB = $DIC['ilDB'];
263 
264  $query = "SELECT description FROM il_meta_rights " .
265  "WHERE rbac_id = " . $ilDB->quote($a_rbac_id, 'integer') . " " .
266  "AND obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
267  $res = $ilDB->query($query);
269  return $row->description ? $row->description : '';
270  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ delete() [1/3]

ilMDRights::delete ( )

Definition at line 122 of file class.ilMDRights.php.

References $ilDB, $query, and ilMDBase\getMetaId().

123  {
124  global $ilDB;
125 
126  if ($this->getMetaId()) {
127  $query = "DELETE FROM il_meta_rights " .
128  "WHERE meta_rights_id = " . $ilDB->quote($this->getMetaId());
129 
130  $this->db->query($query);
131 
132  return true;
133  }
134  return false;
135  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [2/3]

ilMDRights::delete ( )

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

References $DIC, $ilDB, $query, and ilMDBase\getMetaId().

126  {
127  global $DIC;
128 
129  $ilDB = $DIC['ilDB'];
130 
131  if ($this->getMetaId()) {
132  $query = "DELETE FROM il_meta_rights " .
133  "WHERE meta_rights_id = " . $ilDB->quote($this->getMetaId(), 'integer');
134 
135  $this->db->query($query);
136 
137  return true;
138  }
139  return false;
140  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the call graph for this function:

◆ delete() [3/3]

ilMDRights::delete ( )

Definition at line 152 of file class.ilMDRights.php.

References $DIC, $ilDB, $query, and ilMDBase\getMetaId().

153  {
154  global $DIC;
155 
156  $ilDB = $DIC['ilDB'];
157 
158  if ($this->getMetaId()) {
159  $query = "DELETE FROM il_meta_rights " .
160  "WHERE meta_rights_id = " . $ilDB->quote($this->getMetaId(), 'integer');
161 
162  $this->db->query($query);
163 
164  return true;
165  }
166  return false;
167  }
global $DIC
Definition: saml.php:7
$query
global $ilDB
+ Here is the call graph for this function:

◆ getCopyrightAndOtherRestrictions() [1/3]

ilMDRights::getCopyrightAndOtherRestrictions ( )

Definition at line 64 of file class.ilMDRights.php.

65  {
66  return $this->caor;
67  }

◆ getCopyrightAndOtherRestrictions() [2/3]

ilMDRights::getCopyrightAndOtherRestrictions ( )

Definition at line 64 of file class.ilMDRights.php.

65  {
66  return $this->caor;
67  }

◆ getCopyrightAndOtherRestrictions() [3/3]

ilMDRights::getCopyrightAndOtherRestrictions ( )

Definition at line 91 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

92  {
93  return $this->caor;
94  }
+ Here is the caller graph for this function:

◆ getCosts() [1/3]

ilMDRights::getCosts ( )

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

49  {
50  return $this->costs;
51  }

◆ getCosts() [2/3]

ilMDRights::getCosts ( )

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

49  {
50  return $this->costs;
51  }

◆ getCosts() [3/3]

ilMDRights::getCosts ( )

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

Referenced by __getFields(), and toXML().

76  {
77  return $this->costs;
78  }
+ Here is the caller graph for this function:

◆ getDescription() [1/3]

ilMDRights::getDescription ( )

Definition at line 72 of file class.ilMDRights.php.

References $description.

73  {
74  return $this->description;
75  }

◆ getDescription() [2/3]

ilMDRights::getDescription ( )

Definition at line 72 of file class.ilMDRights.php.

References $description.

73  {
74  return $this->description;
75  }

◆ getDescription() [3/3]

ilMDRights::getDescription ( )

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

References $description.

Referenced by __getFields(), and toXML().

100  {
101  return $this->description;
102  }
+ Here is the caller graph for this function:

◆ getDescriptionLanguage() [1/3]

& ilMDRights::getDescriptionLanguage ( )

Definition at line 82 of file class.ilMDRights.php.

83  {
84  return is_object($this->description_language) ? $this->description_language : false;
85  }

◆ getDescriptionLanguage() [2/3]

& ilMDRights::getDescriptionLanguage ( )

Definition at line 82 of file class.ilMDRights.php.

83  {
84  return is_object($this->description_language) ? $this->description_language : false;
85  }

◆ getDescriptionLanguage() [3/3]

& ilMDRights::getDescriptionLanguage ( )

Definition at line 109 of file class.ilMDRights.php.

110  {
111  return is_object($this->description_language) ? $this->description_language : false;
112  }

◆ getDescriptionLanguageCode() [1/3]

ilMDRights::getDescriptionLanguageCode ( )

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

87  {
88  return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
89  }

◆ getDescriptionLanguageCode() [2/3]

ilMDRights::getDescriptionLanguageCode ( )

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

87  {
88  return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
89  }

◆ getDescriptionLanguageCode() [3/3]

ilMDRights::getDescriptionLanguageCode ( )

Definition at line 113 of file class.ilMDRights.php.

Referenced by __getFields(), and toXML().

114  {
115  return is_object($this->description_language) ? $this->description_language->getLanguageCode() : false;
116  }
+ Here is the caller graph for this function:

◆ lookupRightsByTypeAndCopyright()

static ilMDRights::lookupRightsByTypeAndCopyright ( array  $a_types,
array  $a_copyright 
)
static
Parameters
string[]$a_types
string[]$a_copyright
Returns
int[]

Definition at line 40 of file class.ilMDRights.php.

References $DIC, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and ilLoggerFactory\getLogger().

Referenced by ilOerHarvester\collect().

41  {
42  global $DIC;
43 
44  $db = $DIC->database();
45 
46  $query = 'SELECT rbac_id FROM il_meta_rights ' .
47  'WHERE ' . $db->in('obj_type', $a_types, false, 'text') . ' ' .
48  'AND ' . $db->in('description', $a_copyright, false, 'text');
49  $res = $db->query($query);
50 
51  ilLoggerFactory::getLogger('meta')->info($query);
52 
53  $obj_ids = [];
54  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
55  $obj_ids[] = $row->rbac_id;
56  }
57  return $obj_ids;
58  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseDescriptionFromImport()

ilMDRights::parseDescriptionFromImport (   $a_description)
Parameters
$a_description
Exceptions
ilDatabaseException

Definition at line 240 of file class.ilMDRights.php.

References ilMDCopyrightSelectionEntry\createIdentifier(), ilMDCopyrightSelectionEntry\lookupCopyrightByText(), and setDescription().

241  {
242  $entry_id = ilMDCopyrightSelectionEntry::lookupCopyrightByText($a_description);
243  if (!$entry_id) {
244  $this->setDescription($a_description);
245  } else {
247  }
248  }
static createIdentifier($a_entry_id)
Create identifier for entry id.
setDescription($a_description)
+ Here is the call graph for this function:

◆ read() [1/3]

ilMDRights::read ( )

Definition at line 149 of file class.ilMDRights.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), setCopyrightAndOtherRestrictions(), setCosts(), setDescription(), setDescriptionLanguage(), ilMDBase\setObjId(), ilMDBase\setObjType(), ilMDBase\setRBACId(), and ilUtil\stripSlashes().

150  {
151  global $ilDB;
152 
153  include_once 'Services/Migration/DBUpdate_426/classes/class.ilMDLanguageItem.php';
154 
155 
156  if ($this->getMetaId()) {
157  $query = "SELECT * FROM il_meta_rights " .
158  "WHERE meta_rights_id = " . $ilDB->quote($this->getMetaId());
159 
160 
161  $res = $this->db->query($query);
162  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
163  $this->setRBACId($row->rbac_id);
164  $this->setObjId($row->obj_id);
165  $this->setObjType($row->obj_type);
166  $this->setDescription(ilUtil::stripSlashes($row->description));
167  $this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
168  $this->setCosts(ilUtil::stripSlashes($row->costs));
169  $this->setCopyrightAndOtherRestrictions(ilUtil::stripSlashes($row->copyright_and_other_restrictions));
170  }
171  return true;
172  }
173  return false;
174  }
setObjType($a_type)
setCosts($a_costs)
setDescriptionLanguage(&$lng_obj)
foreach($_POST as $key=> $value) $res
setCopyrightAndOtherRestrictions($a_caor)
setObjId($a_id)
setRBACId($a_id)
$query
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$row
global $ilDB
setDescription($a_description)
+ Here is the call graph for this function:

◆ read() [2/3]

ilMDRights::read ( )

Definition at line 154 of file class.ilMDRights.php.

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), setCopyrightAndOtherRestrictions(), setCosts(), setDescription(), setDescriptionLanguage(), ilMDBase\setObjId(), ilMDBase\setObjType(), and ilMDBase\setRBACId().

155  {
156  global $DIC;
157 
158  $ilDB = $DIC['ilDB'];
159 
160  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMDLanguageItem.php';
161 
162 
163  if ($this->getMetaId()) {
164  $query = "SELECT * FROM il_meta_rights " .
165  "WHERE meta_rights_id = " . $ilDB->quote($this->getMetaId(), 'integer');
166 
167 
168  $res = $this->db->query($query);
169  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
170  $this->setRBACId($row->rbac_id);
171  $this->setObjId($row->obj_id);
172  $this->setObjType($row->obj_type);
173  $this->setDescription($row->description);
174  $this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
175  $this->setCosts($row->costs);
176  $this->setCopyrightAndOtherRestrictions($row->cpr_and_or);
177  }
178  return true;
179  }
180  return false;
181  }
setObjType($a_type)
setCosts($a_costs)
global $DIC
Definition: saml.php:7
setDescriptionLanguage(&$lng_obj)
foreach($_POST as $key=> $value) $res
setCopyrightAndOtherRestrictions($a_caor)
setObjId($a_id)
setRBACId($a_id)
$query
$row
global $ilDB
setDescription($a_description)
+ Here is the call graph for this function:

◆ read() [3/3]

ilMDRights::read ( )

Definition at line 181 of file class.ilMDRights.php.

References $DIC, $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, ilMDBase\getMetaId(), setCopyrightAndOtherRestrictions(), setCosts(), setDescription(), setDescriptionLanguage(), ilMDBase\setObjId(), ilMDBase\setObjType(), and ilMDBase\setRBACId().

182  {
183  global $DIC;
184 
185  $ilDB = $DIC['ilDB'];
186 
187  include_once 'Services/MetaData/classes/class.ilMDLanguageItem.php';
188 
189 
190  if ($this->getMetaId()) {
191  $query = "SELECT * FROM il_meta_rights " .
192  "WHERE meta_rights_id = " . $ilDB->quote($this->getMetaId(), 'integer');
193 
194 
195  $res = $this->db->query($query);
196  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
197  $this->setRBACId($row->rbac_id);
198  $this->setObjId($row->obj_id);
199  $this->setObjType($row->obj_type);
200  $this->setDescription($row->description);
201  $this->setDescriptionLanguage(new ilMDLanguageItem($row->description_language));
202  $this->setCosts($row->costs);
203  $this->setCopyrightAndOtherRestrictions($row->cpr_and_or);
204  }
205  return true;
206  }
207  return false;
208  }
setObjType($a_type)
setCosts($a_costs)
global $DIC
Definition: saml.php:7
setDescriptionLanguage(&$lng_obj)
foreach($_POST as $key=> $value) $res
setCopyrightAndOtherRestrictions($a_caor)
setObjId($a_id)
setRBACId($a_id)
$query
$row
global $ilDB
setDescription($a_description)
+ Here is the call graph for this function:

◆ save() [1/3]

ilMDRights::save ( )

Definition at line 91 of file class.ilMDRights.php.

References $DIC, $ilDB, __getFields(), ilMDBase\getMetaId(), and ilMDBase\setMetaId().

92  {
93  global $DIC;
94 
95  $ilDB = $DIC['ilDB'];
96 
97  $fields = $this->__getFields();
98  $fields['meta_rights_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_rights'));
99 
100  if ($this->db->insert('il_meta_rights', $fields)) {
101  $this->setMetaId($next_id);
102  return $this->getMetaId();
103  }
104  return false;
105  }
global $DIC
Definition: saml.php:7
setMetaId($a_meta_id, $a_read_data=true)
global $ilDB
+ Here is the call graph for this function:

◆ save() [2/3]

ilMDRights::save ( )

Definition at line 91 of file class.ilMDRights.php.

References ilDBConstants\AUTOQUERY_INSERT, ilMDBase\getMetaId(), and ilMDBase\setMetaId().

92  {
93  if ($this->db->autoExecute(
94  'il_meta_rights',
95  $this->__getFields(),
97  )) {
98  $this->setMetaId($this->db->getLastInsertId());
99 
100  return $this->getMetaId();
101  }
102  return false;
103  }
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ save() [3/3]

ilMDRights::save ( )

Definition at line 118 of file class.ilMDRights.php.

References $DIC, $ilDB, __getFields(), ilMDBase\getMetaId(), and ilMDBase\setMetaId().

119  {
120  global $DIC;
121 
122  $ilDB = $DIC['ilDB'];
123 
124  $fields = $this->__getFields();
125  $fields['meta_rights_id'] = array('integer',$next_id = $ilDB->nextId('il_meta_rights'));
126 
127  if ($this->db->insert('il_meta_rights', $fields)) {
128  $this->setMetaId($next_id);
129  return $this->getMetaId();
130  }
131  return false;
132  }
global $DIC
Definition: saml.php:7
setMetaId($a_meta_id, $a_read_data=true)
global $ilDB
+ Here is the call graph for this function:

◆ setCopyrightAndOtherRestrictions() [1/3]

ilMDRights::setCopyrightAndOtherRestrictions (   $a_caor)

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

53  {
54  switch ($a_caor) {
55  case 'Yes':
56  case 'No':
57  $this->caor = $a_caor;
58  return true;
59 
60  default:
61  return false;
62  }
63  }

◆ setCopyrightAndOtherRestrictions() [2/3]

ilMDRights::setCopyrightAndOtherRestrictions (   $a_caor)

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

53  {
54  switch ($a_caor) {
55  case 'Yes':
56  case 'No':
57  $this->caor = $a_caor;
58  return true;
59 
60  default:
61  return false;
62  }
63  }

◆ setCopyrightAndOtherRestrictions() [3/3]

ilMDRights::setCopyrightAndOtherRestrictions (   $a_caor)

Definition at line 79 of file class.ilMDRights.php.

Referenced by read().

80  {
81  switch ($a_caor) {
82  case 'Yes':
83  case 'No':
84  $this->caor = $a_caor;
85  return true;
86 
87  default:
88  return false;
89  }
90  }
+ Here is the caller graph for this function:

◆ setCosts() [1/3]

ilMDRights::setCosts (   $a_costs)

Definition at line 36 of file class.ilMDRights.php.

37  {
38  switch ($a_costs) {
39  case 'Yes':
40  case 'No':
41  $this->costs = $a_costs;
42  return true;
43 
44  default:
45  return false;
46  }
47  }

◆ setCosts() [2/3]

ilMDRights::setCosts (   $a_costs)

Definition at line 36 of file class.ilMDRights.php.

37  {
38  switch ($a_costs) {
39  case 'Yes':
40  case 'No':
41  $this->costs = $a_costs;
42  return true;
43 
44  default:
45  return false;
46  }
47  }

◆ setCosts() [3/3]

ilMDRights::setCosts (   $a_costs)

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

Referenced by read().

64  {
65  switch ($a_costs) {
66  case 'Yes':
67  case 'No':
68  $this->costs = $a_costs;
69  return true;
70 
71  default:
72  return false;
73  }
74  }
+ Here is the caller graph for this function:

◆ setDescription() [1/3]

ilMDRights::setDescription (   $a_description)

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

69  {
70  $this->description = $a_description;
71  }

◆ setDescription() [2/3]

ilMDRights::setDescription (   $a_description)

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

69  {
70  $this->description = $a_description;
71  }

◆ setDescription() [3/3]

ilMDRights::setDescription (   $a_description)

Definition at line 95 of file class.ilMDRights.php.

Referenced by parseDescriptionFromImport(), and read().

96  {
97  $this->description = $a_description;
98  }
+ Here is the caller graph for this function:

◆ setDescriptionLanguage() [1/3]

ilMDRights::setDescriptionLanguage ( $lng_obj)

Definition at line 76 of file class.ilMDRights.php.

77  {
78  if (is_object($lng_obj)) {
79  $this->description_language = $lng_obj;
80  }
81  }

◆ setDescriptionLanguage() [2/3]

ilMDRights::setDescriptionLanguage ( $lng_obj)

Definition at line 76 of file class.ilMDRights.php.

77  {
78  if (is_object($lng_obj)) {
79  $this->description_language = $lng_obj;
80  }
81  }

◆ setDescriptionLanguage() [3/3]

ilMDRights::setDescriptionLanguage ( $lng_obj)

Definition at line 103 of file class.ilMDRights.php.

Referenced by read().

104  {
105  if (is_object($lng_obj)) {
106  $this->description_language = $lng_obj;
107  }
108  }
+ Here is the caller graph for this function:

◆ toXML() [1/3]

ilMDRights::toXML ( $writer)

Definition at line 181 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), and getDescriptionLanguageCode().

182  {
183  $writer->xmlStartTag('Rights', array('Costs' => $this->getCosts(),
184  'CopyrightAndOtherRestrictions' => $this->getCopyrightAndOtherRestrictions()));
185  $writer->xmlElement('Description', array('Language' => $this->getDescriptionLanguageCode()), $this->getDescription());
186  $writer->xmlEndTag('Rights');
187  }
getCopyrightAndOtherRestrictions()
+ Here is the call graph for this function:

◆ toXML() [2/3]

ilMDRights::toXML ( $writer)

Definition at line 188 of file class.ilMDRights.php.

References getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getDescriptionLanguageCode(), and ilMDCopyrightSelectionEntry\lookupCopyyrightTitle().

189  {
190  $writer->xmlStartTag('Rights', array('Cost' => $this->getCosts()
191  ? $this->getCosts()
192  : 'No',
193  'CopyrightAndOtherRestrictions' => $this->getCopyrightAndOtherRestrictions()
195  : 'No'));
196  include_once './Services/Migration/DBUpdate_5295/classes/class.ilMDCopyrightSelectionEntry.php';
197  $writer->xmlElement(
198  'Description',
199  array('Language' => $this->getDescriptionLanguageCode()
200  ? $this->getDescriptionLanguageCode()
201  : 'en'),
203  );
204  $writer->xmlEndTag('Rights');
205  }
getCopyrightAndOtherRestrictions()
static lookupCopyyrightTitle($a_cp_string)
Lookup copyright title.
+ Here is the call graph for this function:

◆ toXML() [3/3]

ilMDRights::toXML ( $writer)

Definition at line 215 of file class.ilMDRights.php.

References ilMDCopyrightSelectionEntry\_lookupCopyright(), getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), and getDescriptionLanguageCode().

216  {
217  $writer->xmlStartTag('Rights', array('Cost' => $this->getCosts()
218  ? $this->getCosts()
219  : 'No',
220  'CopyrightAndOtherRestrictions' => $this->getCopyrightAndOtherRestrictions()
222  : 'No'));
223  include_once './Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php';
224  $writer->xmlElement(
225  'Description',
226  [
227  'Language' => $this->getDescriptionLanguageCode()
228  ? $this->getDescriptionLanguageCode()
229  : 'en'
230  ],
232  );
233  $writer->xmlEndTag('Rights');
234  }
getCopyrightAndOtherRestrictions()
static _lookupCopyright($a_cp_string)
lookup copyright by entry id
+ Here is the call graph for this function:

◆ update() [1/3]

ilMDRights::update ( )

Definition at line 105 of file class.ilMDRights.php.

References $ilDB, ilDBConstants\AUTOQUERY_UPDATE, and ilMDBase\getMetaId().

106  {
107  global $ilDB;
108 
109  if ($this->getMetaId()) {
110  if ($this->db->autoExecute(
111  'il_meta_rights',
112  $this->__getFields(),
114  "meta_rights_id = " . $ilDB->quote($this->getMetaId())
115  )) {
116  return true;
117  }
118  }
119  return false;
120  }
global $ilDB
+ Here is the call graph for this function:

◆ update() [2/3]

ilMDRights::update ( )

Definition at line 107 of file class.ilMDRights.php.

References $DIC, $ilDB, and ilMDBase\getMetaId().

108  {
109  global $DIC;
110 
111  $ilDB = $DIC['ilDB'];
112 
113  if ($this->getMetaId()) {
114  if ($this->db->update(
115  'il_meta_rights',
116  $this->__getFields(),
117  array("meta_rights_id" => array('integer',$this->getMetaId()))
118  )) {
119  return true;
120  }
121  }
122  return false;
123  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

◆ update() [3/3]

ilMDRights::update ( )

Definition at line 134 of file class.ilMDRights.php.

References $DIC, $ilDB, and ilMDBase\getMetaId().

135  {
136  global $DIC;
137 
138  $ilDB = $DIC['ilDB'];
139 
140  if ($this->getMetaId()) {
141  if ($this->db->update(
142  'il_meta_rights',
143  $this->__getFields(),
144  array("meta_rights_id" => array('integer',$this->getMetaId()))
145  )) {
146  return true;
147  }
148  }
149  return false;
150  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the call graph for this function:

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