57 $this->entry_id = $a_entry_id;
72 $query =
"SELECT entry_id FROM il_md_cpr_selections ";
78 return $entries ? $entries : array();
90 if(!
$entry_id = self::_extractEntryId($a_cp_string))
95 $query =
"SELECT title FROM il_md_cpr_selections ".
96 "WHERE entry_id = ".$ilDB->quote(
$entry_id).
" ";
99 return $row->title ?
$row->title :
'';
115 if(!
$entry_id = self::_extractEntryId($a_cp_string))
120 $query =
"SELECT copyright FROM il_md_cpr_selections ".
121 "WHERE entry_id = ".$ilDB->quote(
$entry_id).
" ";
124 return $row->copyright ?
$row->copyright :
'';
137 if(!preg_match(
'/il_copyright_entry__([0-9]+)__([0-9]+)/',$a_cp_string,$matches))
141 if($matches[1] != IL_INST_ID)
145 return $matches[2] ? $matches[2] : 0;
181 $this->title = $a_title;
204 $this->description = $a_desc;
214 return $this->description;
226 $this->copyright = $a_copyright;
248 $this->costs = $a_costs;
270 $this->language = $a_lang_key;
292 $this->copyright_and_other_restrictions = $a_status;
317 $next_id = $ilDB->nextId(
'il_md_cpr_selections');
319 $ilDB->insert(
'il_md_cpr_selections',array(
320 'entry_id' => array(
'integer',$next_id),
321 'title' => array(
'text',$this->
getTitle()),
325 'costs' => array(
'integer',$this->
getCosts()),
328 $this->entry_id = $next_id;
342 $ilDB->update(
'il_md_cpr_selections',array(
343 'title' => array(
'text',$this->
getTitle()),
347 'costs' => array(
'integer',$this->
getCosts()),
350 'entry_id' => array(
'integer',$this->
getEntryId())
361 public function delete()
365 $query =
"DELETE FROM il_md_cpr_selections ".
366 "WHERE entry_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
398 $query =
"SELECT * FROM il_md_cpr_selections ".
399 "WHERE entry_id = ".$this->db->quote($this->entry_id ,
'integer').
" ";
412 $desc = $ilDB->quote(
'il_copyright_entry__'.IL_INST_ID.
'__'.$this->getEntryId(),
'text');
413 $query =
"SELECT count(meta_rights_id) used FROM il_meta_rights ".
414 "WHERE description = ".$ilDB->quote($desc ,
'text');
417 $this->usage =
$row->used;
getLanguage()
get language
static _getEntries()
get entries
setLanguage($a_lang_key)
set language
setCosts($a_costs)
set costs
setDescription($a_desc)
set description
getCopyrightAndOtherRestrictions()
get copyright and other restrictions
getCopyright()
get copyright
setCopyrightAndOtherRestrictions($a_status)
set copyright and other restrictions
const DB_FETCHMODE_OBJECT
static _extractEntryId($a_cp_string)
extract entry id
__construct($a_entry_id)
Constructor.
static _lookupCopyright($a_cp_string)
lookup copyright by entry id
getDescription()
get description
setTitle($a_title)
set title
static lookupCopyyrightTitle($a_cp_string)
Lookup copyright title.
$copyright_and_other_restrictions
setCopyright($a_copyright)
set copyright