ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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

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  }
global $DIC
Definition: saml.php:7
+ 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.

References $query, and getObjId().

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
+ Here is the call graph for this function:

◆ getHarvestRefId()

ilOerHarvesterObjectStatus::getHarvestRefId ( )

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

References $harvest_ref_id.

Referenced by save().

+ Here is the caller graph for this function:

◆ getObjId()

ilOerHarvesterObjectStatus::getObjId ( )

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

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.

Referenced by save().

+ Here is the caller graph for this function:

◆ isCreated()

ilOerHarvesterObjectStatus::isCreated ( )

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

References $harvest_ref_id.

◆ lookupHarvested()

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

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

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

Referenced by ilOerHarvester\deleteDeprecated().

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
+ 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.

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

Referenced by ilOerHarvester\deleteObject().

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  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
+ Here is the caller graph for this function:

◆ read()

ilOerHarvesterObjectStatus::read ( )
Exceptions
ilDatabaseException

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

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

Referenced by __construct().

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  }
foreach($_POST as $key=> $value) $res
$query
$row
+ 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.

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

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  }
foreach($_POST as $key=> $value) $res
$query
+ Here is the call graph for this function:

◆ setBlocked()

ilOerHarvesterObjectStatus::setBlocked (   $a_stat)

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

Referenced by read(), and ilMDEditorGUI\updateQuickEdit().

95  {
96  $this->blocked = $a_stat;
97  }
+ Here is the caller graph for this function:

◆ setHarvestRefId()

ilOerHarvesterObjectStatus::setHarvestRefId (   $a_ref_id)

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

Referenced by ilOerHarvester\harvestObject(), and read().

85  {
86  $this->harvest_ref_id = $a_ref_id;
87  }
+ Here is the caller graph for this function:

◆ setObjId()

ilOerHarvesterObjectStatus::setObjId (   $a_obj_id)

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

Referenced by read().

75  {
76  $this->obj_id = $a_obj_id;
77  }
+ 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: