ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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 21 of file class.ilECSParticipantConsents.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, $mid, and $server_id.

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

Member Function Documentation

◆ delete()

ilECSParticipantConsents::delete ( )

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

References ilDBConstants\T_INTEGER.

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

◆ hasConsents()

ilECSParticipantConsents::hasConsents ( )

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

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

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

Field Documentation

◆ $db

ilDBInterface ilECSParticipantConsents::$db
protected

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

◆ $mid

int ilECSParticipantConsents::$mid
private

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

Referenced by __construct().

◆ $server_id

int ilECSParticipantConsents::$server_id
private

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

Referenced by __construct().


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