58 $this->logger =
$GLOBALS[
'DIC']->logger()->meta();
59 $this->db =
$GLOBALS[
'DIC']->database();
60 $this->entry_id = $a_entry_id;
75 $query =
"SELECT entry_id FROM il_md_cpr_selections ";
81 return $entries ? $entries : array();
93 if(!
$entry_id = self::_extractEntryId($a_cp_string))
98 $query =
"SELECT title FROM il_md_cpr_selections ".
99 "WHERE entry_id = ".$ilDB->quote(
$entry_id).
" ";
102 return $row->title ?
$row->title :
'';
118 if(!
$entry_id = self::_extractEntryId($a_cp_string))
123 $query =
"SELECT copyright FROM il_md_cpr_selections ".
124 "WHERE entry_id = ".$ilDB->quote(
$entry_id).
" ";
127 return $row->copyright ?
$row->copyright :
'';
140 if(!preg_match(
'/il_copyright_entry__([0-9]+)__([0-9]+)/',$a_cp_string,$matches))
144 if($matches[1] != IL_INST_ID)
148 return $matches[2] ? $matches[2] : 0;
184 $this->title = $a_title;
207 $this->description = $a_desc;
217 return $this->description;
229 $this->copyright = $a_copyright;
251 $this->costs = $a_costs;
273 $this->language = $a_lang_key;
295 $this->copyright_and_other_restrictions = $a_status;
320 $next_id =
$ilDB->nextId(
'il_md_cpr_selections');
322 $ilDB->insert(
'il_md_cpr_selections',array(
323 'entry_id' => array(
'integer',$next_id),
324 'title' => array(
'text',$this->
getTitle()),
328 'costs' => array(
'integer',$this->
getCosts()),
331 $this->entry_id = $next_id;
345 $ilDB->update(
'il_md_cpr_selections',array(
346 'title' => array(
'text',$this->
getTitle()),
350 'costs' => array(
'integer',$this->
getCosts()),
353 'entry_id' => array(
'integer',$this->
getEntryId())
364 public function delete()
368 $query =
"DELETE FROM il_md_cpr_selections ".
369 "WHERE entry_id = ".$this->db->quote($this->
getEntryId() ,
'integer').
" ";
401 $query =
"SELECT * FROM il_md_cpr_selections ".
402 "WHERE entry_id = ".$this->db->quote($this->entry_id ,
'integer').
" ";
415 $query =
"SELECT count(meta_rights_id) used FROM il_meta_rights ".
416 "WHERE description = ".$ilDB->quote(
'il_copyright_entry__'.IL_INST_ID.
'__'.$this->getEntryId(),
'text');
418 $this->logger->debug(
$query);
422 $this->usage =
$row->used;
An exception for terminatinating execution or to throw for unit testing.
__construct($a_entry_id)
Constructor.
getCopyright()
get copyright
static _extractEntryId($a_cp_string)
extract entry id
setCopyright($a_copyright)
set copyright
getDescription()
get description
setCopyrightAndOtherRestrictions($a_status)
set copyright and other restrictions
setDescription($a_desc)
set description
setCosts($a_costs)
set costs
setLanguage($a_lang_key)
set language
static lookupCopyyrightTitle($a_cp_string)
Lookup copyright title.
getCopyrightAndOtherRestrictions()
get copyright and other restrictions
static _lookupCopyright($a_cp_string)
lookup copyright by entry id
setTitle($a_title)
set title
getLanguage()
get language
$copyright_and_other_restrictions
static _getEntries()
get entries
$GLOBALS['loaded']
Global hash that tracks already loaded includes.