ILIAS  release_8 Revision v8.24
ilOerHarvesterObjectStatus Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilOerHarvesterObjectStatus:

Public Member Functions

 __construct (int $obj_id=0)
 
 setObjId (int $a_obj_id)
 
 getObjId ()
 
 setHarvestRefId (int $a_ref_id)
 
 getHarvestRefId ()
 
 setBlocked (bool $a_stat)
 
 isBlocked ()
 
 isCreated ()
 
 save ()
 
 delete ()
 
 read ()
 

Static Public Member Functions

static lookupHarvested ()
 
static lookupObjIdByHarvestingId (int $a_href_id)
 

Protected Attributes

ilDBInterface $db
 

Private Attributes

int $obj_id
 
int $harvest_ref_id = 0
 
bool $blocked = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning OER harvester object status

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 27 of file class.ilOerHarvesterObjectStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ilOerHarvesterObjectStatus::__construct ( int  $obj_id = 0)

Definition at line 37 of file class.ilOerHarvesterObjectStatus.php.

38 {
39 global $DIC;
40
41 $this->db = $DIC->database();
42
43 $this->obj_id = $obj_id;
44 if ($this->obj_id) {
45 $this->read();
46 }
47 }
global $DIC
Definition: feed.php:28

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

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilOerHarvesterObjectStatus::delete ( )

Definition at line 131 of file class.ilOerHarvesterObjectStatus.php.

131 : bool
132 {
133 $query = 'DELETE FROM il_meta_oer_stat ' .
134 'WHERE obj_id = ' . $this->db->quote($this->getObjId(), 'integer');
135 $this->db->manipulate($query);
136 return true;
137 }
$query

References $query, and getObjId().

+ Here is the call graph for this function:

◆ getHarvestRefId()

ilOerHarvesterObjectStatus::getHarvestRefId ( )

Definition at line 97 of file class.ilOerHarvesterObjectStatus.php.

References $harvest_ref_id.

◆ getObjId()

ilOerHarvesterObjectStatus::getObjId ( )

Definition at line 87 of file class.ilOerHarvesterObjectStatus.php.

87 : int
88 {
89 return $this->obj_id;
90 }

References $obj_id.

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

+ Here is the caller graph for this function:

◆ isBlocked()

ilOerHarvesterObjectStatus::isBlocked ( )

Definition at line 107 of file class.ilOerHarvesterObjectStatus.php.

107 : bool
108 {
109 return $this->blocked;
110 }

References $blocked.

◆ isCreated()

ilOerHarvesterObjectStatus::isCreated ( )

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

112 : bool
113 {
114 return (bool) $this->harvest_ref_id;
115 }

References $harvest_ref_id.

◆ lookupHarvested()

static ilOerHarvesterObjectStatus::lookupHarvested ( )
static
Returns
int[]

Definition at line 52 of file class.ilOerHarvesterObjectStatus.php.

52 : array
53 {
54 global $DIC;
55
56 $db = $DIC->database();
57
58 $query = 'SELECT href_id FROM il_meta_oer_stat ';
59 $res = $db->query($query);
60
61 $hids = [];
62 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
63 $hids[] = (int) $row->href_id;
64 }
65 return $hids;
66 }
query(string $query)
Run a (read-only) Query on the database.
$res
Definition: ltiservices.php:69

References $db, $DIC, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ILIAS\Repository\int(), and ilDBInterface\query().

Referenced by ilOerHarvester\deleteDeprecated().

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

◆ lookupObjIdByHarvestingId()

static ilOerHarvesterObjectStatus::lookupObjIdByHarvestingId ( int  $a_href_id)
static

Definition at line 68 of file class.ilOerHarvesterObjectStatus.php.

68 : int
69 {
70 global $DIC;
71
72 $db = $DIC->database();
73 $query = 'SELECT obj_id FROM il_meta_oer_stat ' .
74 'WHERE href_id = ' . $db->quote($a_href_id, 'integer');
75 $res = $db->query($query);
76 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
77 return (int) $row->obj_id;
78 }
79 return 0;
80 }
quote($value, string $type)

References $db, $DIC, $query, $res, ilDBConstants\FETCHMODE_OBJECT, ilDBInterface\query(), and ilDBInterface\quote().

Referenced by ilOerHarvester\deleteObject().

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

◆ read()

ilOerHarvesterObjectStatus::read ( )

Definition at line 139 of file class.ilOerHarvesterObjectStatus.php.

139 : void
140 {
141 $query = 'SELECT * FROM il_meta_oer_stat ' .
142 'WHERE obj_id = ' . $this->db->quote($this->getObjId(), 'integer');
143 $res = $this->db->query($query);
144 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
145 $this->setObjId((int) $row->obj_id);
146 $this->setHarvestRefId((int) $row->href_id);
147 $this->setBlocked((bool) $row->blocked);
148 }
149 }

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, getObjId(), setBlocked(), setHarvestRefId(), and setObjId().

Referenced by __construct().

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

◆ save()

ilOerHarvesterObjectStatus::save ( )

Definition at line 117 of file class.ilOerHarvesterObjectStatus.php.

117 : bool
118 {
119 $this->delete();
120 $query = 'INSERT INTO il_meta_oer_stat ' .
121 '(obj_id, href_id, blocked ) ' .
122 'VALUES (' .
123 $this->db->quote($this->getObjId(), 'integer') . ', ' .
124 $this->db->quote($this->getHarvestRefId(), 'integer') . ', ' .
125 $this->db->quote($this->isBlocked(), 'integer') .
126 ')';
127 $res = $this->db->manipulate($query);
128 return true;
129 }

References $query, $res, and getObjId().

+ Here is the call graph for this function:

◆ setBlocked()

ilOerHarvesterObjectStatus::setBlocked ( bool  $a_stat)

Definition at line 102 of file class.ilOerHarvesterObjectStatus.php.

102 : void
103 {
104 $this->blocked = $a_stat;
105 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setHarvestRefId()

ilOerHarvesterObjectStatus::setHarvestRefId ( int  $a_ref_id)

Definition at line 92 of file class.ilOerHarvesterObjectStatus.php.

92 : void
93 {
94 $this->harvest_ref_id = $a_ref_id;
95 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setObjId()

ilOerHarvesterObjectStatus::setObjId ( int  $a_obj_id)

Definition at line 82 of file class.ilOerHarvesterObjectStatus.php.

82 : void
83 {
84 $this->obj_id = $a_obj_id;
85 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $blocked

bool ilOerHarvesterObjectStatus::$blocked = false
private

Definition at line 33 of file class.ilOerHarvesterObjectStatus.php.

Referenced by isBlocked().

◆ $db

ilDBInterface ilOerHarvesterObjectStatus::$db
protected

◆ $harvest_ref_id

int ilOerHarvesterObjectStatus::$harvest_ref_id = 0
private

Definition at line 31 of file class.ilOerHarvesterObjectStatus.php.

Referenced by getHarvestRefId(), and isCreated().

◆ $obj_id

int ilOerHarvesterObjectStatus::$obj_id
private

Definition at line 29 of file class.ilOerHarvesterObjectStatus.php.

Referenced by __construct(), and getObjId().


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