ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMDCopyrightSelectionEntry Class Reference
+ Collaboration diagram for ilMDCopyrightSelectionEntry:

Public Member Functions

 __construct ($a_entry_id)
 Constructor. More...
 
 getUsage ()
 get usage More...
 
 getEntryId ()
 get entry id More...
 
 setTitle ($a_title)
 set title More...
 
 getTitle ()
 get title More...
 
 setDescription ($a_desc)
 set description More...
 
 getDescription ()
 get description More...
 
 setCopyright ($a_copyright)
 set copyright More...
 
 getCopyright ()
 get copyright More...
 
 setCosts ($a_costs)
 set costs More...
 
 getCosts ()
 get costs More...
 
 setLanguage ($a_lang_key)
 set language More...
 
 getLanguage ()
 get language More...
 
 setCopyrightAndOtherRestrictions ($a_status)
 set copyright and other restrictions More...
 
 getCopyrightAndOtherRestrictions ()
 get copyright and other restrictions More...
 
 add ()
 Add entry. More...
 
 update ()
 update More...
 
 delete ()
 delete More...
 
 validate ()
 validate More...
 

Static Public Member Functions

static _getEntries ()
 get entries More...
 
static lookupCopyyrightTitle ($a_cp_string)
 Lookup copyright title. More...
 
static _lookupCopyright ($a_cp_string)
 lookup copyright by entry id More...
 
static _extractEntryId ($a_cp_string)
 extract entry id More...
 

Protected Attributes

 $logger = null
 
 $db
 

Private Member Functions

 read ()
 Read entry. More...
 

Private Attributes

 $entry_id
 
 $title
 
 $decription
 
 $copyright
 
 $costs
 
 $language
 
 $copyright_and_other_restrictions
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 32 of file class.ilMDCopyrightSelectionEntry.php.

Constructor & Destructor Documentation

◆ __construct()

ilMDCopyrightSelectionEntry::__construct (   $a_entry_id)

Constructor.

@access public

Parameters
intentry id

Definition at line 53 of file class.ilMDCopyrightSelectionEntry.php.

54 {
55 global $DIC;
56
57
58 $this->logger = $GLOBALS['DIC']->logger()->meta();
59 $this->db = $GLOBALS['DIC']->database();
60 $this->entry_id = $a_entry_id;
61 $this->read();
62 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $DIC
Definition: saml.php:7

References $DIC, $GLOBALS, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ _extractEntryId()

static ilMDCopyrightSelectionEntry::_extractEntryId (   $a_cp_string)
static

extract entry id

@access public

Parameters

Definition at line 135 of file class.ilMDCopyrightSelectionEntry.php.

136 {
137 if (!preg_match('/il_copyright_entry__([0-9]+)__([0-9]+)/', $a_cp_string, $matches)) {
138 return 0;
139 }
140 if ($matches[1] != IL_INST_ID) {
141 return 0;
142 }
143 return $matches[2] ? $matches[2] : 0;
144 }

Referenced by ilMDCopyrightSelectionGUI\fillTemplate(), and ilCopyrightInputGUI\insert().

+ Here is the caller graph for this function:

◆ _getEntries()

static ilMDCopyrightSelectionEntry::_getEntries ( )
static

get entries

@access public

Definition at line 71 of file class.ilMDCopyrightSelectionEntry.php.

72 {
73 global $ilDB;
74
75 $query = "SELECT entry_id FROM il_md_cpr_selections ";
76 $res = $ilDB->query($query);
77 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
78 $entries[] = new ilMDCopyrightSelectionEntry($row->entry_id);
79 }
80 return $entries ? $entries : array();
81 }
$query
foreach($_POST as $key=> $value) $res
global $ilDB

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMDCopyrightSelectionGUI\fillTemplate(), ilCopyrightInputGUI\insert(), and ilMDCopyrightTableGUI\parseSelections().

+ Here is the caller graph for this function:

◆ _lookupCopyright()

static ilMDCopyrightSelectionEntry::_lookupCopyright (   $a_cp_string)
static

lookup copyright by entry id

@access public

Parameters
stringcopyright string il_copyright_entry__IL_INST_ID__ENTRY_ID

Definition at line 112 of file class.ilMDCopyrightSelectionEntry.php.

113 {
114 global $ilDB;
115
116 if (!$entry_id = self::_extractEntryId($a_cp_string)) {
117 return $a_cp_string;
118 }
119
120 $query = "SELECT copyright FROM il_md_cpr_selections " .
121 "WHERE entry_id = " . $ilDB->quote($entry_id) . " ";
122 $res = $ilDB->query($query);
124 return $row->copyright ? $row->copyright : '';
125 }

References $entry_id, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMDUtils\_parseCopyright().

+ Here is the caller graph for this function:

◆ add()

ilMDCopyrightSelectionEntry::add ( )

Add entry.

@access public

Definition at line 311 of file class.ilMDCopyrightSelectionEntry.php.

312 {
313 global $ilDB;
314
315 $next_id = $ilDB->nextId('il_md_cpr_selections');
316
317 $ilDB->insert('il_md_cpr_selections', array(
318 'entry_id' => array('integer',$next_id),
319 'title' => array('text',$this->getTitle()),
320 'description' => array('clob',$this->getDescription()),
321 'copyright' => array('clob',$this->getCopyright()),
322 'language' => array('text',$this->getLanguage()),
323 'costs' => array('integer',$this->getCosts()),
324 'cpr_restrictions' => array('integer',$this->getCopyrightAndOtherRestrictions())
325 ));
326 $this->entry_id = $next_id;
327 return true;
328 }
getCopyrightAndOtherRestrictions()
get copyright and other restrictions

References $ilDB, getCopyright(), getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getLanguage(), and getTitle().

+ Here is the call graph for this function:

◆ delete()

ilMDCopyrightSelectionEntry::delete ( )

delete

@access public

Definition at line 359 of file class.ilMDCopyrightSelectionEntry.php.

360 {
361 global $ilDB;
362
363 $query = "DELETE FROM il_md_cpr_selections " .
364 "WHERE entry_id = " . $this->db->quote($this->getEntryId(), 'integer') . " ";
365 $res = $ilDB->manipulate($query);
366 }

References $ilDB, $query, $res, and getEntryId().

+ Here is the call graph for this function:

◆ getCopyright()

ilMDCopyrightSelectionEntry::getCopyright ( )

get copyright

@access publi

Definition at line 232 of file class.ilMDCopyrightSelectionEntry.php.

References $copyright.

Referenced by add(), and update().

+ Here is the caller graph for this function:

◆ getCopyrightAndOtherRestrictions()

ilMDCopyrightSelectionEntry::getCopyrightAndOtherRestrictions ( )

get copyright and other restrictions

@access public

Parameters

Definition at line 300 of file class.ilMDCopyrightSelectionEntry.php.

301 {
302 // Fixed
303 return true;
304 }

Referenced by add(), and update().

+ Here is the caller graph for this function:

◆ getCosts()

ilMDCopyrightSelectionEntry::getCosts ( )

get costs

@access public

Definition at line 254 of file class.ilMDCopyrightSelectionEntry.php.

References $costs.

Referenced by add(), and update().

+ Here is the caller graph for this function:

◆ getDescription()

ilMDCopyrightSelectionEntry::getDescription ( )

get description

@access public

Definition at line 210 of file class.ilMDCopyrightSelectionEntry.php.

211 {
212 return $this->description;
213 }

References $description.

Referenced by add(), and update().

+ Here is the caller graph for this function:

◆ getEntryId()

ilMDCopyrightSelectionEntry::getEntryId ( )

get entry id

@access public

Parameters

Definition at line 165 of file class.ilMDCopyrightSelectionEntry.php.

166 {
167 return $this->entry_id;
168 }

References $entry_id.

Referenced by delete(), read(), and update().

+ Here is the caller graph for this function:

◆ getLanguage()

ilMDCopyrightSelectionEntry::getLanguage ( )

get language

@access public

Definition at line 277 of file class.ilMDCopyrightSelectionEntry.php.

References $language.

Referenced by add(), and update().

+ Here is the caller graph for this function:

◆ getTitle()

ilMDCopyrightSelectionEntry::getTitle ( )

get title

@access public

Definition at line 188 of file class.ilMDCopyrightSelectionEntry.php.

References $title.

Referenced by add(), update(), and validate().

+ Here is the caller graph for this function:

◆ getUsage()

ilMDCopyrightSelectionEntry::getUsage ( )

get usage

@access public

Parameters

Definition at line 153 of file class.ilMDCopyrightSelectionEntry.php.

154 {
155 return $this->usage;
156 }

◆ lookupCopyyrightTitle()

static ilMDCopyrightSelectionEntry::lookupCopyyrightTitle (   $a_cp_string)
static

Lookup copyright title.

Currently used for export of meta data

Parameters
type$a_cp_string

Definition at line 88 of file class.ilMDCopyrightSelectionEntry.php.

89 {
90 global $ilDB;
91
92 if (!$entry_id = self::_extractEntryId($a_cp_string)) {
93 return $a_cp_string;
94 }
95
96 $query = "SELECT title FROM il_md_cpr_selections " .
97 "WHERE entry_id = " . $ilDB->quote($entry_id) . " ";
98 $res = $ilDB->query($query);
100 return $row->title ? $row->title : '';
101 }

References $entry_id, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilMDRights\toXML().

+ Here is the caller graph for this function:

◆ read()

ilMDCopyrightSelectionEntry::read ( )
private

Read entry.

@access private

Parameters

Definition at line 390 of file class.ilMDCopyrightSelectionEntry.php.

391 {
392 global $ilDB;
393
394 $query = "SELECT * FROM il_md_cpr_selections " .
395 "WHERE entry_id = " . $this->db->quote($this->entry_id, 'integer') . " ";
396 $res = $this->db->query($query);
397 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
398 $this->setTitle($row->title);
399 $this->setDescription($row->description);
400 $this->setCopyright($row->copyright);
401 $this->setLanguage($row->language);
402 $this->setCosts($row->costs);
403 // Fixed
405 }
406
407 $query = "SELECT count(meta_rights_id) used FROM il_meta_rights " .
408 "WHERE description = " . $ilDB->quote('il_copyright_entry__' . IL_INST_ID . '__' . $this->getEntryId(), 'text');
409
410 $this->logger->debug($query);
411
412 $res = $this->db->query($query);
414 $this->usage = $row->used;
415 }
setCopyrightAndOtherRestrictions($a_status)
set copyright and other restrictions

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getEntryId(), setCopyright(), setCopyrightAndOtherRestrictions(), setCosts(), setDescription(), setLanguage(), and setTitle().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCopyright()

ilMDCopyrightSelectionEntry::setCopyright (   $a_copyright)

set copyright

@access public

Parameters
string$copyright

Definition at line 222 of file class.ilMDCopyrightSelectionEntry.php.

223 {
224 $this->copyright = $a_copyright;
225 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCopyrightAndOtherRestrictions()

ilMDCopyrightSelectionEntry::setCopyrightAndOtherRestrictions (   $a_status)

set copyright and other restrictions

@access public

Parameters
boolcopyright and other restrictions

Definition at line 288 of file class.ilMDCopyrightSelectionEntry.php.

289 {
290 $this->copyright_and_other_restrictions = $a_status;
291 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setCosts()

ilMDCopyrightSelectionEntry::setCosts (   $a_costs)

set costs

@access public

Parameters

Definition at line 244 of file class.ilMDCopyrightSelectionEntry.php.

245 {
246 $this->costs = $a_costs;
247 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDescription()

ilMDCopyrightSelectionEntry::setDescription (   $a_desc)

set description

@access public

Parameters
stringdescription

Definition at line 200 of file class.ilMDCopyrightSelectionEntry.php.

201 {
202 $this->description = $a_desc;
203 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setLanguage()

ilMDCopyrightSelectionEntry::setLanguage (   $a_lang_key)

set language

@access public

Parameters
stringlanguage key

Definition at line 266 of file class.ilMDCopyrightSelectionEntry.php.

267 {
268 $this->language = $a_lang_key;
269 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilMDCopyrightSelectionEntry::setTitle (   $a_title)

set title

@access public

Parameters
stringtitle

Definition at line 177 of file class.ilMDCopyrightSelectionEntry.php.

178 {
179 $this->title = $a_title;
180 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilMDCopyrightSelectionEntry::update ( )

update

@access public

Definition at line 336 of file class.ilMDCopyrightSelectionEntry.php.

337 {
338 global $ilDB;
339
340 $ilDB->update('il_md_cpr_selections', array(
341 'title' => array('text',$this->getTitle()),
342 'description' => array('clob',$this->getDescription()),
343 'copyright' => array('clob',$this->getCopyright()),
344 'language' => array('text',$this->getLanguage()),
345 'costs' => array('integer',$this->getCosts()),
346 'cpr_restrictions' => array('integer',$this->getCopyrightAndOtherRestrictions())
347 ), array(
348 'entry_id' => array('integer',$this->getEntryId())
349 ));
350 return true;
351 }

References $ilDB, getCopyright(), getCopyrightAndOtherRestrictions(), getCosts(), getDescription(), getEntryId(), getLanguage(), and getTitle().

+ Here is the call graph for this function:

◆ validate()

ilMDCopyrightSelectionEntry::validate ( )

validate

@access public

Parameters

Definition at line 375 of file class.ilMDCopyrightSelectionEntry.php.

376 {
377 if (!strlen($this->getTitle())) {
378 return false;
379 }
380 return true;
381 }

References getTitle().

+ Here is the call graph for this function:

Field Documentation

◆ $copyright

ilMDCopyrightSelectionEntry::$copyright
private

Definition at line 40 of file class.ilMDCopyrightSelectionEntry.php.

Referenced by getCopyright().

◆ $copyright_and_other_restrictions

ilMDCopyrightSelectionEntry::$copyright_and_other_restrictions
private

Definition at line 43 of file class.ilMDCopyrightSelectionEntry.php.

◆ $costs

ilMDCopyrightSelectionEntry::$costs
private

Definition at line 41 of file class.ilMDCopyrightSelectionEntry.php.

Referenced by getCosts().

◆ $db

ilMDCopyrightSelectionEntry::$db
protected

Definition at line 35 of file class.ilMDCopyrightSelectionEntry.php.

◆ $decription

ilMDCopyrightSelectionEntry::$decription
private

Definition at line 39 of file class.ilMDCopyrightSelectionEntry.php.

◆ $entry_id

ilMDCopyrightSelectionEntry::$entry_id
private

◆ $language

ilMDCopyrightSelectionEntry::$language
private

Definition at line 42 of file class.ilMDCopyrightSelectionEntry.php.

Referenced by getLanguage().

◆ $logger

ilMDCopyrightSelectionEntry::$logger = null
protected

Definition at line 34 of file class.ilMDCopyrightSelectionEntry.php.

◆ $title

ilMDCopyrightSelectionEntry::$title
private

Definition at line 38 of file class.ilMDCopyrightSelectionEntry.php.

Referenced by getTitle().


The documentation for this class was generated from the following file: