ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDclNotification Class Reference
+ Collaboration diagram for ilDclNotification:

Public Member Functions

 __construct (private readonly ILDBInterface $db)
 
 has (ilObjDataCollection $obj, int $user_id, ilDclNotificationType $type)
 
 add (ilObjDataCollection $obj, ilObjUser $user, ilDclNotificationType $type)
 
 delete (ilObjDataCollection $obj, ilObjUser $user, ilDclNotificationType $type)
 
 clear (ilObjDataCollection $obj, ilObjUser $user)
 
 deleteForObject (ilObjDataCollection $obj)
 
 deleteForUser (int $user_id)
 

Private Attributes

const string TABLE_NAME = 'il_dcl_notification'
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilDclNotification::__construct ( private readonly ILDBInterface  $db)

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

26 {
27 }

Member Function Documentation

◆ add()

ilDclNotification::add ( ilObjDataCollection  $obj,
ilObjUser  $user,
ilDclNotificationType  $type 
)

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

38 : void
39 {
40 if (!$this->has($obj, $user->getId(), $type)) {
41 $this->db->insert('il_dcl_notification', [
42 'obj_id' => [ilDBConstants::T_INTEGER, $obj->getId()],
43 'usr_id' => [ilDBConstants::T_INTEGER, $user->getId()],
44 'setting' => [ilDBConstants::T_INTEGER, $type->value]
45 ]);
46 }
47 }
has(ilObjDataCollection $obj, int $user_id, ilDclNotificationType $type)

References ilObject\getId(), has(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ clear()

ilDclNotification::clear ( ilObjDataCollection  $obj,
ilObjUser  $user 
)

Definition at line 58 of file class.ilDclNotification.php.

58 : void
59 {
60 $this->db->manipulateF(
61 'DELETE FROM ' . $this::TABLE_NAME . ' WHERE obj_id = %s AND usr_id = %s',
63 [$obj->getId(), $user->getId()]
64 );
65 }

References ilObject\getId(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ delete()

ilDclNotification::delete ( ilObjDataCollection  $obj,
ilObjUser  $user,
ilDclNotificationType  $type 
)

Definition at line 49 of file class.ilDclNotification.php.

49 : void
50 {
51 $this->db->manipulateF(
52 'DELETE FROM ' . $this::TABLE_NAME . ' WHERE obj_id = %s AND usr_id = %s AND setting = %s',
54 [$obj->getId(), $user->getId(), $type->value]
55 );
56 }

References ilObject\getId(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ deleteForObject()

ilDclNotification::deleteForObject ( ilObjDataCollection  $obj)

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

67 : void
68 {
69 $this->db->manipulateF(
70 'DELETE FROM ' . $this::TABLE_NAME . ' WHERE obj_id = %s',
72 [$obj->getId()]
73 );
74 }

References ilObject\getId(), and ilDBConstants\T_INTEGER.

+ Here is the call graph for this function:

◆ deleteForUser()

ilDclNotification::deleteForUser ( int  $user_id)

Definition at line 76 of file class.ilDclNotification.php.

76 : void
77 {
78 $this->db->manipulateF(
79 'DELETE FROM ' . $this::TABLE_NAME . ' WHERE usr_id = %s',
81 [$user_id]
82 );
83 }

References $user_id, and ilDBConstants\T_INTEGER.

◆ has()

ilDclNotification::has ( ilObjDataCollection  $obj,
int  $user_id,
ilDclNotificationType  $type 
)

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

29 : bool
30 {
31 return null !== $this->db->fetchAssoc($this->db->queryF(
32 'SELECT 1 FROM ' . $this::TABLE_NAME . ' WHERE obj_id = %s AND usr_id = %s AND setting = %s LIMIT 1',
34 [$obj->getId(), $user_id, $type->value]
35 ));
36 }

References $user_id, ilObject\getId(), and ilDBConstants\T_INTEGER.

Referenced by add().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ TABLE_NAME

const string ilDclNotification::TABLE_NAME = 'il_dcl_notification'
private

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


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