ILIAS  release_8 Revision v8.24
ilECSParticipantConsents Class Reference
+ Collaboration diagram for ilECSParticipantConsents:

Public Member Functions

 __construct (int $server_id, int $mid)
 
 delete ()
 
 hasConsents ()
 

Protected Attributes

ilDBInterface $db
 

Private Attributes

int $server_id
 
int $mid
 

Detailed Description

Definition at line 20 of file class.ilECSParticipantConsents.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSParticipantConsents::__construct ( int  $server_id,
int  $mid 
)

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

28 {
29 global $DIC;
30
31 $this->db = $DIC->database();
32
33 $this->server_id = $server_id;
34 $this->mid = $mid;
35 }
global $DIC
Definition: feed.php:28

References $DIC, $mid, and $server_id.

Member Function Documentation

◆ delete()

ilECSParticipantConsents::delete ( )

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

37 : void
38 {
39 $query = 'DELETE FROM ecs_user_consent ' .
40 'WHERE mid = ' . $this->db->quote($this->mid, ilDBConstants::T_INTEGER) . ' ' .
41 'AND server_id = ' . $this->db->quote($this->server_id, ilDBConstants::T_INTEGER);
42 $this->db->manipulate($query);
43 }
$query

References $query, and ilDBConstants\T_INTEGER.

◆ hasConsents()

ilECSParticipantConsents::hasConsents ( )

Definition at line 45 of file class.ilECSParticipantConsents.php.

45 : bool
46 {
47 $query = 'SELECT count(*) as num FROM ecs_user_consent ' .
48 'WHERE mid = ' . $this->db->quote($this->mid, ilDBConstants::T_INTEGER) . ' ' .
49 'AND server_id = ' . $this->db->quote($this->server_id, ilDBConstants::T_INTEGER);
50 $res = $this->db->query($query);
51 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
52 return (bool) $row->num;
53 }
54 return false;
55 }
$res
Definition: ltiservices.php:69

References $query, $res, ilDBConstants\FETCHMODE_OBJECT, and ilDBConstants\T_INTEGER.

Field Documentation

◆ $db

ilDBInterface ilECSParticipantConsents::$db
protected

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

◆ $mid

int ilECSParticipantConsents::$mid
private

Definition at line 23 of file class.ilECSParticipantConsents.php.

Referenced by __construct().

◆ $server_id

int ilECSParticipantConsents::$server_id
private

Definition at line 22 of file class.ilECSParticipantConsents.php.

Referenced by __construct().


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