57 $this->entry_id = $a_entry_id;
72 $query =
"SELECT entry_id FROM il_md_copyright_selections ";
73 $res = $ilDB->query($query);
78 return $entries ? $entries : array();
93 if(!
$entry_id = self::_extractEntryId($a_cp_string))
98 $query =
"SELECT copyright FROM il_md_copyright_selections ".
99 "WHERE entry_id = ".$ilDB->quote(
$entry_id).
" ";
100 $res = $ilDB->query($query);
102 return $row->copyright ? $row->copyright :
'';
115 if(!preg_match(
'/il_copyright_entry__([0-9]+)__([0-9]+)/',$a_cp_string,$matches))
119 if($matches[1] != IL_INST_ID)
123 return $matches[2] ? $matches[2] : 0;
159 $this->title = $a_title;
182 $this->description = $a_desc;
192 return $this->description;
204 $this->copyright = $a_copyright;
226 $this->costs = $a_costs;
248 $this->language = $a_lang_key;
270 $this->copyright_and_other_restrictions = $a_status;
293 $query =
"INSERT INTO il_md_copyright_selections ".
294 "SET title = ".$this->db->quote($this->
getTitle()).
", ".
296 "copyright = ".$this->db->quote($this->
getCopyright()).
", ".
297 "language = ".$this->db->quote($this->
getLanguage()).
", ".
298 "costs = ".$this->db->quote($this->
getCosts()).
", ".
300 $this->db->query($query);
301 $this->entry_id = $this->db->getLastInsertId();
314 $query =
"UPDATE il_md_copyright_selections ".
315 "SET title = ".$this->db->quote($this->
getTitle()).
", ".
317 "copyright = ".$this->db->quote($this->
getCopyright()).
", ".
318 "language = ".$this->db->quote($this->
getLanguage()).
", ".
319 "costs = ".$this->db->quote($this->
getCosts()).
", ".
321 "WHERE entry_id = ".$this->db->quote($this->
getEntryId()).
" ";
323 $this->db->query($query);
332 public function delete()
334 $query =
"DELETE FROM il_md_copyright_selections ".
335 "WHERE entry_id = ".$this->db->quote($this->
getEntryId()).
" ";
336 $this->db->query($query);
365 $query =
"SELECT * FROM il_md_copyright_selections ".
366 "WHERE entry_id = ".$this->db->quote($this->entry_id).
" ";
367 $res = $this->db->query($query);
379 $query =
"SELECT count(meta_rights_id) as used FROM il_meta_rights ".
380 "WHERE description = 'il_copyright_entry__".IL_INST_ID.
'__'.$this->
getEntryId().
"'";
381 $res = $this->db->query($query);
383 $this->usage = $row->used;