ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLinkCheckNotify Class Reference

class for checking external links in page objects. More...

+ Collaboration diagram for ilLinkCheckNotify:

Public Member Functions

 __construct ($db)
 
 setUserId ($a_usr_id)
 
 getUserId ()
 
 setObjId ($a_obj_id)
 
 getObjId ()
 
 addNotifier ()
 
 deleteNotifier ()
 

Static Public Member Functions

static _getNotifyStatus ($a_usr_id, $a_obj_id)
 
static _deleteUser ($a_usr_id)
 
static _deleteObject ($a_obj_id)
 
static _getNotifiers ($a_obj_id)
 
static _getAllNotifiers (&$db)
 

Data Fields

 $db = null
 

Detailed Description

class for checking external links in page objects.

All user who want to get messages about invalid links of a page_object are stored here

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

Definition at line 11 of file class.ilLinkCheckNotify.php.

Constructor & Destructor Documentation

◆ __construct()

ilLinkCheckNotify::__construct (   $db)

Definition at line 16 of file class.ilLinkCheckNotify.php.

References $db.

17  {
18  $this->db = $db;
19  }

Member Function Documentation

◆ _deleteObject()

static ilLinkCheckNotify::_deleteObject (   $a_obj_id)
static

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

References $DIC, $ilDB, $query, and $res.

Referenced by ilObjLinkResource\delete(), and ilwebresourceTest\testLinkCheck().

98  {
99  global $DIC;
100 
101  $ilDB = $DIC['ilDB'];
102 
103  $query = "DELETE FROM link_check_report " .
104  "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
105  $res = $ilDB->manipulate($query);
106 
107  return true;
108  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _deleteUser()

static ilLinkCheckNotify::_deleteUser (   $a_usr_id)
static

Definition at line 85 of file class.ilLinkCheckNotify.php.

References $DIC, $ilDB, $query, and $res.

Referenced by ilObjUser\delete().

86  {
87  global $DIC;
88 
89  $ilDB = $DIC['ilDB'];
90 
91  $query = "DELETE FROM link_check_report " .
92  "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer');
93  $res = $ilDB->manipulate($query);
94  return true;
95  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ _getAllNotifiers()

static ilLinkCheckNotify::_getAllNotifiers ( $db)
static

Definition at line 127 of file class.ilLinkCheckNotify.php.

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

Referenced by ilLinkChecker\__sendMail().

128  {
129  global $DIC;
130 
131  $ilDB = $DIC['ilDB'];
132 
133  $query = "SELECT * FROM link_check_report ";
134 
135  $res = $db->query($query);
136  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
137  $usr_ids[$row->usr_id][] = $row->obj_id;
138  }
139 
140  return $usr_ids ? $usr_ids : array();
141  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _getNotifiers()

static ilLinkCheckNotify::_getNotifiers (   $a_obj_id)
static

Definition at line 110 of file class.ilLinkCheckNotify.php.

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

Referenced by ilwebresourceTest\testLinkCheck().

111  {
112  global $DIC;
113 
114  $ilDB = $DIC['ilDB'];
115 
116  $query = "SELECT * FROM link_check_report " .
117  "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
118 
119  $res = $ilDB->query($query);
120  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
121  $usr_ids[] = $row->usr_id;
122  }
123 
124  return $usr_ids ? $usr_ids : array();
125  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ _getNotifyStatus()

static ilLinkCheckNotify::_getNotifyStatus (   $a_usr_id,
  $a_obj_id 
)
static

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

References $DIC, $ilDB, $query, and $res.

Referenced by ilObjLinkResourceGUI\linkChecker(), ilObjContentObjectGUI\linkChecker(), and ilwebresourceTest\testLinkCheck().

72  {
73  global $DIC;
74 
75  $ilDB = $DIC['ilDB'];
76 
77  $query = "SELECT * FROM link_check_report " .
78  "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
79  "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer');
80  $res = $ilDB->query($query);
81 
82  return $res->numRows() ? true : false;
83  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ addNotifier()

ilLinkCheckNotify::addNotifier ( )

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

References $DIC, $ilDB, $query, $res, deleteNotifier(), getObjId(), and getUserId().

39  {
40  global $DIC;
41 
42  $ilDB = $DIC['ilDB'];
43 
44  $this->deleteNotifier();
45 
46  $query = "INSERT INTO link_check_report (obj_id,usr_id) " .
47  "VALUES ( " .
48  $ilDB->quote($this->getObjId(), 'integer') . ", " .
49  $ilDB->quote($this->getUserId(), 'integer') .
50  ")";
51  $res = $ilDB->manipulate($query);
52 
53  return true;
54  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ deleteNotifier()

ilLinkCheckNotify::deleteNotifier ( )

Definition at line 56 of file class.ilLinkCheckNotify.php.

References $DIC, $ilDB, $query, $res, getObjId(), and getUserId().

Referenced by addNotifier().

57  {
58  global $DIC;
59 
60  $ilDB = $DIC['ilDB'];
61 
62  $query = "DELETE FROM link_check_report " .
63  "WHERE obj_id = " . $ilDB->quote($this->getObjId(), 'integer') . " " .
64  "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . " ";
65  $res = $ilDB->manipulate($query);
66 
67  return true;
68  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getObjId()

ilLinkCheckNotify::getObjId ( )

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

Referenced by addNotifier(), and deleteNotifier().

34  {
35  return $this->obj_id;
36  }
+ Here is the caller graph for this function:

◆ getUserId()

ilLinkCheckNotify::getUserId ( )

Definition at line 25 of file class.ilLinkCheckNotify.php.

Referenced by addNotifier(), and deleteNotifier().

26  {
27  return $this->usr_id;
28  }
+ Here is the caller graph for this function:

◆ setObjId()

ilLinkCheckNotify::setObjId (   $a_obj_id)

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

30  {
31  $this->obj_id = $a_obj_id;
32  }

◆ setUserId()

ilLinkCheckNotify::setUserId (   $a_usr_id)

Definition at line 21 of file class.ilLinkCheckNotify.php.

22  {
23  $this->usr_id = $a_usr_id;
24  }

Field Documentation

◆ $db

ilLinkCheckNotify::$db = null

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

Referenced by __construct(), and _getAllNotifiers().


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