ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
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.

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

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)
+ Here is the call graph for this function:

◆ clear()

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

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

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

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

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

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  }
+ Here is the call graph for this function:

◆ deleteForObject()

ilDclNotification::deleteForObject ( ilObjDataCollection  $obj)

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

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

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

◆ deleteForUser()

ilDclNotification::deleteForUser ( int  $user_id)

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

References ilDBConstants\T_INTEGER.

Referenced by ilDataCollectionAppEventListener\handleEvent().

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

◆ has()

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

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

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

Referenced by add().

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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: