ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilOerHarvesterObjectStatus Class Reference

OER harvester object status. More...

+ Collaboration diagram for ilOerHarvesterObjectStatus:

Public Member Functions

 __construct ($obj_id=0)
 ilOerHarvesterObjectStatus constructor. More...
 
 setObjId ($a_obj_id)
 
 getObjId ()
 
 setHarvestRefId ($a_ref_id)
 
 getHarvestRefId ()
 
 setBlocked ($a_stat)
 
 isBlocked ()
 
 isCreated ()
 
 save ()
 
 delete ()
 Delete by obj_id. More...
 
 read ()
 

Static Public Member Functions

static lookupHarvested ()
 
static lookupObjIdByHarvestingId ($a_href_id)
 

Private Attributes

 $obj_id = 0
 
 $harvest_ref_id = 0
 
 $blocked = false
 
 $db = null
 

Detailed Description

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 11 of file class.ilOerHarvesterObjectStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ilOerHarvesterObjectStatus::__construct (   $obj_id = 0)

ilOerHarvesterObjectStatus constructor.

Parameters
int$obj_id

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

27 {
28 global $DIC;
29
30 $this->db = $DIC->database();
31
32 $this->obj_id = $obj_id;
33 if ($this->obj_id) {
34 $this->read();
35 }
36 }
$DIC
Definition: xapitoken.php:46

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

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilOerHarvesterObjectStatus::delete ( )

Delete by obj_id.

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

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

References $query, and getObjId().

+ Here is the call graph for this function:

◆ getHarvestRefId()

ilOerHarvesterObjectStatus::getHarvestRefId ( )

◆ getObjId()

ilOerHarvesterObjectStatus::getObjId ( )

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

80 {
81 return $this->obj_id;
82 }

References $obj_id.

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

+ Here is the caller graph for this function:

◆ isBlocked()

ilOerHarvesterObjectStatus::isBlocked ( )

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

References $blocked.

◆ isCreated()

ilOerHarvesterObjectStatus::isCreated ( )

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

105 {
106 return (bool) $this->harvest_ref_id;
107 }

References $harvest_ref_id.

◆ lookupHarvested()

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

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

43 {
44 global $DIC;
45
46 $db = $DIC->database();
47
48 $query = 'SELECT href_id FROM il_meta_oer_stat ';
49 $res = $db->query($query);
50
51 $hids = [];
52 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
53 $hids[] = $row->href_id;
54 }
55 return $hids;
56 }
foreach($_POST as $key=> $value) $res

References $db, $DIC, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilOerHarvester\deleteDeprecated().

+ Here is the caller graph for this function:

◆ lookupObjIdByHarvestingId()

static ilOerHarvesterObjectStatus::lookupObjIdByHarvestingId (   $a_href_id)
static
Parameters
$a_href_id

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

62 {
63 global $DIC;
64
65 $db = $DIC->database();
66 $query = 'SELECT obj_id FROM il_meta_oer_stat ' .
67 'WHERE href_id = ' . $db->quote($a_href_id, 'integer');
68 $res = $db->query($query);
69 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
70 return $row->obj_id;
71 }
72 }

References $db, $DIC, $query, $res, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilOerHarvester\deleteObject().

+ Here is the caller graph for this function:

◆ read()

ilOerHarvesterObjectStatus::read ( )
Exceptions
ilDatabaseException

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

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

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 ( )
Returns
bool

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

113 {
114 $this->delete();
115 $query = 'INSERT INTO il_meta_oer_stat ' .
116 '(obj_id, href_id, blocked ) ' .
117 'VALUES (' .
118 $this->db->quote($this->getObjId(), 'integer') . ', ' .
119 $this->db->quote($this->getHarvestRefId(), 'integer') . ', ' .
120 $this->db->quote($this->isBlocked(), 'integer') .
121 ')';
122 $res = $this->db->manipulate($query);
123 return true;
124 }

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

+ Here is the call graph for this function:

◆ setBlocked()

ilOerHarvesterObjectStatus::setBlocked (   $a_stat)

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

95 {
96 $this->blocked = $a_stat;
97 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setHarvestRefId()

ilOerHarvesterObjectStatus::setHarvestRefId (   $a_ref_id)

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

85 {
86 $this->harvest_ref_id = $a_ref_id;
87 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setObjId()

ilOerHarvesterObjectStatus::setObjId (   $a_obj_id)

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

75 {
76 $this->obj_id = $a_obj_id;
77 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $blocked

ilOerHarvesterObjectStatus::$blocked = false
private

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

Referenced by isBlocked().

◆ $db

ilOerHarvesterObjectStatus::$db = null
private

◆ $harvest_ref_id

ilOerHarvesterObjectStatus::$harvest_ref_id = 0
private

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

Referenced by getHarvestRefId(), and isCreated().

◆ $obj_id

ilOerHarvesterObjectStatus::$obj_id = 0
private

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

Referenced by __construct(), and getObjId().


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