ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilMD5295Rights Class Reference
+ Inheritance diagram for ilMD5295Rights:
+ Collaboration diagram for ilMD5295Rights:

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)
 
- Public Member Functions inherited from ilMD5295Base
 __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 _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 ilMD5295Base
 $rbac_id
 
 $obj_id
 
 $obj_type
 
 $export_mode = false
 
- Protected Attributes inherited from ilMD5295Base
 $log
 

Detailed Description

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

Member Function Documentation

◆ __getFields()

ilMD5295Rights::__getFields ( )

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

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

Referenced by save().

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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getId()

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

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

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

Referenced by ilMD5295\getRights().

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  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _lookupDescription()

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

Lookup description (copyright)

public

Parameters
intrbac_id
intobj_id

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

References $DIC, $ilDB, $query, $res, 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);
225  $row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT);
226  return $row->description ? $row->description : '';
227  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
$DIC
Definition: xapitoken.php:46

◆ delete()

ilMD5295Rights::delete ( )

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

References $DIC, $ilDB, $query, and ilMD5295Base\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  }
$query
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ getCopyrightAndOtherRestrictions()

ilMD5295Rights::getCopyrightAndOtherRestrictions ( )

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

Referenced by __getFields(), and toXML().

65  {
66  return $this->caor;
67  }
+ Here is the caller graph for this function:

◆ getCosts()

ilMD5295Rights::getCosts ( )

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

Referenced by __getFields(), and toXML().

49  {
50  return $this->costs;
51  }
+ Here is the caller graph for this function:

◆ getDescription()

ilMD5295Rights::getDescription ( )

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

Referenced by __getFields(), and toXML().

73  {
74  return $this->description;
75  }
+ Here is the caller graph for this function:

◆ getDescriptionLanguage()

& ilMD5295Rights::getDescriptionLanguage ( )

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

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

◆ getDescriptionLanguageCode()

ilMD5295Rights::getDescriptionLanguageCode ( )

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

Referenced by __getFields(), and toXML().

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

◆ read()

ilMD5295Rights::read ( )

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

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

155  {
156  global $DIC;
157 
158  $ilDB = $DIC['ilDB'];
159 
160  include_once 'Services/Migration/DBUpdate_5295/classes/class.ilMD5295LanguageItem.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 ilMD5295LanguageItem($row->description_language));
175  $this->setCosts($row->costs);
176  $this->setCopyrightAndOtherRestrictions($row->cpr_and_or);
177  }
178  return true;
179  }
180  return false;
181  }
setDescription($a_description)
foreach($_POST as $key=> $value) $res
setCopyrightAndOtherRestrictions($a_caor)
$query
setDescriptionLanguage(&$lng_obj)
global $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ save()

ilMD5295Rights::save ( )

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

References $DIC, $ilDB, __getFields(), ilMD5295Base\getMetaId(), and ilMD5295Base\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 $ilDB
$DIC
Definition: xapitoken.php:46
setMetaId($a_meta_id, $a_read_data=true)
+ Here is the call graph for this function:

◆ setCopyrightAndOtherRestrictions()

ilMD5295Rights::setCopyrightAndOtherRestrictions (   $a_caor)

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

Referenced by read().

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  }
+ Here is the caller graph for this function:

◆ setCosts()

ilMD5295Rights::setCosts (   $a_costs)

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

Referenced by read().

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  }
+ Here is the caller graph for this function:

◆ setDescription()

ilMD5295Rights::setDescription (   $a_description)

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

Referenced by read().

69  {
70  $this->description = $a_description;
71  }
+ Here is the caller graph for this function:

◆ setDescriptionLanguage()

ilMD5295Rights::setDescriptionLanguage ( $lng_obj)

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

Referenced by read().

77  {
78  if (is_object($lng_obj)) {
79  $this->description_language = $lng_obj;
80  }
81  }
+ Here is the caller graph for this function:

◆ toXML()

ilMD5295Rights::toXML ( $writer)

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

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

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.ilMD5295CopyrightSelectionEntry.php';
197  $writer->xmlElement(
198  'Description',
199  array('Language' => $this->getDescriptionLanguageCode()
200  ? $this->getDescriptionLanguageCode()
201  : 'en'),
202  ilMD5295CopyrightSelectionEntry::lookupCopyyrightTitle($this->getDescription())
203  );
204  $writer->xmlEndTag('Rights');
205  }
+ Here is the call graph for this function:

◆ update()

ilMD5295Rights::update ( )

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

References $DIC, $ilDB, and ilMD5295Base\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 $ilDB
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

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