ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

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

References $db.

Member Function Documentation

◆ _deleteObject()

static ilLinkCheckNotify::_deleteObject (   $a_obj_id)
static

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

90 {
91 global $ilDB;
92
93 $query = "DELETE FROM link_check_report " .
94 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
95 $res = $ilDB->manipulate($query);
96
97 return true;
98 }
$query
foreach($_POST as $key=> $value) $res
global $ilDB

References $ilDB, $query, and $res.

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

+ Here is the caller graph for this function:

◆ _deleteUser()

static ilLinkCheckNotify::_deleteUser (   $a_usr_id)
static

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

80 {
81 global $ilDB;
82
83 $query = "DELETE FROM link_check_report " .
84 "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer');
85 $res = $ilDB->manipulate($query);
86 return true;
87 }

References $ilDB, $query, and $res.

Referenced by ilObjUser\delete().

+ Here is the caller graph for this function:

◆ _getAllNotifiers()

static ilLinkCheckNotify::_getAllNotifiers ( $db)
static

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

116 {
117 global $ilDB;
118
119 $query = "SELECT * FROM link_check_report ";
120
121 $res = $db->query($query);
122 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
123 $usr_ids[$row->usr_id][] = $row->obj_id;
124 }
125
126 return $usr_ids ? $usr_ids : array();
127 }

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

Referenced by ilLinkChecker\__sendMail().

+ Here is the caller graph for this function:

◆ _getNotifiers()

static ilLinkCheckNotify::_getNotifiers (   $a_obj_id)
static

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

101 {
102 global $ilDB;
103
104 $query = "SELECT * FROM link_check_report " .
105 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " ";
106
107 $res = $ilDB->query($query);
108 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
109 $usr_ids[] = $row->usr_id;
110 }
111
112 return $usr_ids ? $usr_ids : array();
113 }

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

Referenced by ilwebresourceTest\testLinkCheck().

+ Here is the caller graph for this function:

◆ _getNotifyStatus()

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

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

68 {
69 global $ilDB;
70
71 $query = "SELECT * FROM link_check_report " .
72 "WHERE obj_id = " . $ilDB->quote($a_obj_id, 'integer') . " " .
73 "AND usr_id = " . $ilDB->quote($a_usr_id, 'integer');
74 $res = $ilDB->query($query);
75
76 return $res->numRows() ? true : false;
77 }

References $ilDB, $query, and $res.

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

+ Here is the caller graph for this function:

◆ addNotifier()

ilLinkCheckNotify::addNotifier ( )

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

39 {
40 global $ilDB;
41
42 $this->deleteNotifier();
43
44 $query = "INSERT INTO link_check_report (obj_id,usr_id) " .
45 "VALUES ( " .
46 $ilDB->quote($this->getObjId(), 'integer') . ", " .
47 $ilDB->quote($this->getUserId(), 'integer') .
48 ")";
49 $res = $ilDB->manipulate($query);
50
51 return true;
52 }

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

+ Here is the call graph for this function:

◆ deleteNotifier()

ilLinkCheckNotify::deleteNotifier ( )

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

55 {
56 global $ilDB;
57
58 $query = "DELETE FROM link_check_report " .
59 "WHERE obj_id = " . $ilDB->quote($this->getObjId(), 'integer') . " " .
60 "AND usr_id = " . $ilDB->quote($this->getUserId(), 'integer') . " ";
61 $res = $ilDB->manipulate($query);
62
63 return true;
64 }

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

Referenced by addNotifier().

+ 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.

34 {
35 return $this->obj_id;
36 }

Referenced by addNotifier(), and deleteNotifier().

+ Here is the caller graph for this function:

◆ getUserId()

ilLinkCheckNotify::getUserId ( )

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

26 {
27 return $this->usr_id;
28 }

Referenced by addNotifier(), and deleteNotifier().

+ 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: