69        $this->logger = 
$GLOBALS[
'DIC']->logger()->meta();
 
   70        $this->db = 
$GLOBALS[
'DIC']->database();
 
   71        $this->entry_id = $a_entry_id;
 
   89        $query = 
"SELECT entry_id FROM il_md_cpr_selections ORDER BY is_default DESC, position ASC";
 
  110        if (!
$entry_id = self::_extractEntryId($a_cp_string)) {
 
  114        $query = 
"SELECT title FROM il_md_cpr_selections " .
 
  118        return $row->title ? 
$row->title : 
'';
 
  136        if (!
$entry_id = self::_extractEntryId($a_cp_string)) {
 
  140        $query = 
"SELECT copyright FROM il_md_cpr_selections " .
 
  144        return $row->copyright ? 
$row->copyright : 
'';
 
  158        $query = 
'SELECT entry_id FROM il_md_cpr_selections ' .
 
  159            'WHERE copyright = ' . 
$db->quote($copyright_text, 
'text');
 
  162            return $row->entry_id;
 
  178        if (!preg_match(
'/il_copyright_entry__([0-9]+)__([0-9]+)/', $a_cp_string, $matches)) {
 
  181        if ($matches[1] != IL_INST_ID) {
 
  184        return $matches[2] ? $matches[2] : 0;
 
  217        $query = 
"SELECT is_default FROM il_md_cpr_selections " .
 
  218            "WHERE entry_id = " . $this->db->quote($this->entry_id, 
'integer');
 
  223        return $row[
'is_default'];
 
  232        $this->outdated = (int) $a_value;
 
  252        $query = 
"SELECT entry_id FROM il_md_cpr_selections " .
 
  253            "WHERE is_default = " . 
$db->quote(1, 
'integer');
 
  258        return $row[
'entry_id'];
 
  270        $this->title = $a_title;
 
  293        $this->description = $a_desc;
 
  315        $this->copyright = $a_copyright;
 
  337        $this->costs = $a_costs;
 
  359        $this->language = $a_lang_key;
 
  381        $this->copyright_and_other_restrictions = $a_status;
 
  403        $this->order_position = (int) $a_position;
 
  417        $query = 
"SELECT count(entry_id) total FROM il_md_cpr_selections";
 
  421        return $row[
'total'] + 1;
 
  435        $next_id = 
$ilDB->nextId(
'il_md_cpr_selections');
 
  437        $ilDB->insert(
'il_md_cpr_selections', array(
 
  438            'entry_id' => array(
'integer',$next_id),
 
  439            'title' => array(
'text',$this->
getTitle()),
 
  443            'costs' => array(
'integer',$this->
getCosts()),
 
  447        $this->entry_id = $next_id;
 
  463        $ilDB->update(
'il_md_cpr_selections', array(
 
  464            'title' => array(
'text',$this->
getTitle()),
 
  468            'costs' => array(
'integer',$this->
getCosts()),
 
  470            'outdated' => array(
'integer',$this->
getOutdated()),
 
  473                'entry_id' => array(
'integer',$this->
getEntryId())
 
  484    public function delete()
 
  490        $query = 
"DELETE FROM il_md_cpr_selections " .
 
  491            "WHERE entry_id = " . $this->db->quote($this->
getEntryId(), 
'integer') . 
" ";
 
  523        $query = 
"SELECT * FROM il_md_cpr_selections " .
 
  524            "WHERE entry_id = " . $this->db->quote($this->entry_id, 
'integer') . 
" " .
 
  525            "ORDER BY is_default DESC, position ASC ";
 
  540        $query = 
"SELECT count(meta_rights_id) used FROM il_meta_rights " .
 
  541            "WHERE description = " . 
$ilDB->quote(
'il_copyright_entry__' . IL_INST_ID . 
'__' . $this->
getEntryId(), 
'text');
 
  545        $this->usage = 
$row->used;
 
  555        return 'il_copyright_entry__' . IL_INST_ID . 
'__' . $a_entry_id;
 
An exception for terminatinating execution or to throw for unit testing.
__construct($a_entry_id)
Constructor.
static createIdentifier($a_entry_id)
Create identifier for entry id.
getCopyright()
get copyright
setOrderPosition($a_position)
Set the order position in the table of copyrights.
static _extractEntryId($a_cp_string)
extract entry id
setCopyright($a_copyright)
set copyright
getOrderPosition()
Get the order position in the table of copyrights.
getDescription()
get description
static getDefault()
Get default.
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
setOutdated($a_value)
Set copyright element as outdated and not usable anymore.
getLanguage()
get language
static lookupCopyrightByText($copyright_text)
$copyright_and_other_restrictions
static _getEntries()
get entries
getIsDefault()
Get if the entry is default No setter for this.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
foreach($_POST as $key=> $value) $res