57 $this->entry_id = $a_entry_id;
72 $query =
"SELECT entry_id FROM il_md_cpr_selections ";
78 return $entries ? $entries : array();
93 if(!
$entry_id = self::_extractEntryId($a_cp_string))
98 $query =
"SELECT copyright FROM il_md_cpr_selections ".
99 "WHERE entry_id = ".$ilDB->quote(
$entry_id).
" ";
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;
295 $next_id = $ilDB->nextId(
'il_md_cpr_selections');
297 $ilDB->insert(
'il_md_cpr_selections',array(
298 'entry_id' => array(
'integer',$next_id),
299 'title' => array(
'text',$this->
getTitle()),
303 'costs' => array(
'integer',$this->
getCosts()),
306 $this->entry_id = $next_id;
320 $ilDB->update(
'il_md_cpr_selections',array(
321 'title' => array(
'text',$this->
getTitle()),
325 'costs' => array(
'integer',$this->
getCosts()),
328 'entry_id' => array(
'integer',$this->
getEntryId())
339 public function delete()
343 $query =
"DELETE FROM il_md_cpr_selections ".
344 "WHERE entry_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
376 $query =
"SELECT * FROM il_md_cpr_selections ".
377 "WHERE entry_id = ".$this->db->quote($this->entry_id ,
'integer').
" ";
390 $desc = $ilDB->quote(
'il_copyright_entry__'.IL_INST_ID.
'__'.$this->getEntryId(),
'text');
391 $query =
"SELECT count(meta_rights_id) used FROM il_meta_rights ".
392 "WHERE description = ".$ilDB->quote(
$desc ,
'text');
395 $this->usage =
$row->used;