ILIAS  release_8 Revision v8.23
ilADNDismiss Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilADNDismiss:
+ Collaboration diagram for ilADNDismiss:

Public Member Functions

 getConnectorContainerName ()
 
 getId ()
 
 setId (int $id)
 
 getUsrId ()
 
 setUsrId (int $usr_id)
 
 getNotificationId ()
 
 setNotificationId (int $notification_id)
 
- Public Member Functions inherited from ActiveRecord
 getArConnector ()
 
 getArFieldList ()
 
 getConnectorContainerName ()
 Return the Name of your Connector Table More...
 
 setConnectorContainerName (string $connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0)
 
 storeObjectToCache ()
 
 asStdClass ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy (int $new_id=0)
 
 afterObjectLoad ()
 
 read ()
 
 update ()
 
 delete ()
 
 __call ($name, $arguments)
 

Static Public Member Functions

static returnDbTableName ()
 
static hasDimissed (ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
 
static dismiss (ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
 
- Static Public Member Functions inherited from ActiveRecord
static returnDbTableName ()
 
static installDB ()
 
static renameDBField (string $old_name, string $new_name)
 
static tableExists ()
 
static fieldExists (string $field_name)
 
static removeDBField (string $field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 never use in ILIAS Core, Plugins only More...
 
static preloadObjects ()
 
static additionalParams (array $additional_params)
 
static findOrFail ($primary_key, array $add_constructor_args=array())
 Tries to find the object and throws an Exception if object is not found, instead of returning null. More...
 
static findOrGetInstance ($primary_key, array $add_constructor_args=array())
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $ar, $on_this, $on_external, array $fields=array(' *'), string $operator='=', $both_external=false)
 
static innerjoin ( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
 
static leftjoin ( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
 
static orderBy ($orderBy, string $orderDirection='ASC')
 
static dateFormat (string $date_format='d.m.Y - H:i:s')
 
static limit ($start, $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $connector)
 
static raw (bool $set_raw=true)
 
static getArray (?string $key=null, $values=null)
 
static _toCamelCase (string $str, bool $capitalise_first_char=false)
 

Data Fields

const TABLE_NAME = 'il_adn_dismiss'
 

Protected Attributes

int $id = null
 true true true integer 8 true More...
 
int $usr_id = 0
 true integer 8 More...
 
int $notification_id = 0
 true integer 8 More...
 
- Protected Attributes inherited from ActiveRecord
bool $ar_safe_read = true
 
string $connector_container_name = ''
 
bool $is_new = true
 

Static Protected Attributes

static array $request_cache = array()
 

Additional Inherited Members

- Protected Member Functions inherited from ActiveRecord
 installDatabase ()
 
- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 Returns an instance of the instatiated calling active record (needs to be done in static methods) : This should be cached somehow More...
 
static fromCamelCase (string $str)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilADNDismiss

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

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

Member Function Documentation

◆ dismiss()

static ilADNDismiss::dismiss ( ilObjUser  $ilObjUser,
ilADNNotification  $ilADNNotification 
)
static

Definition at line 57 of file class.ilADNDismiss.php.

References ilObject\getId(), ilADNNotification\getId(), and ilADNNotification\isUserAllowedToDismiss().

Referenced by ilADNNotification\dismiss().

57  : void
58  {
59  if (!self::hasDimissed($ilObjUser, $ilADNNotification) && $ilADNNotification->isUserAllowedToDismiss($ilObjUser)) {
60  $obj = new self();
61  $obj->setNotificationId($ilADNNotification->getId());
62  $obj->setUsrId($ilObjUser->getId());
63  $obj->create();
64  }
65  }
isUserAllowedToDismiss(ilObjUser $user)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getConnectorContainerName()

ilADNDismiss::getConnectorContainerName ( )

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

28  : string
29  {
30  return self::TABLE_NAME;
31  }

◆ getId()

ilADNDismiss::getId ( )

Definition at line 99 of file class.ilADNDismiss.php.

References $id.

99  : ?int
100  {
101  return $this->id;
102  }
int $id
true true true integer 8 true

◆ getNotificationId()

ilADNDismiss::getNotificationId ( )

Definition at line 119 of file class.ilADNDismiss.php.

References $notification_id.

119  : int
120  {
121  return $this->notification_id;
122  }
int $notification_id
true integer 8

◆ getUsrId()

ilADNDismiss::getUsrId ( )

Definition at line 109 of file class.ilADNDismiss.php.

References $usr_id.

109  : int
110  {
111  return $this->usr_id;
112  }
int $usr_id
true integer 8

◆ hasDimissed()

static ilADNDismiss::hasDimissed ( ilObjUser  $ilObjUser,
ilADNNotification  $ilADNNotification 
)
static

Definition at line 43 of file class.ilADNDismiss.php.

References $usr_id, ilObject\getId(), and ilADNNotification\getId().

Referenced by ILIAS\AdministrativeNotification\GlobalScreen\ADNProvider\getNotifications(), and ilADNNotification\hasUserDismissed().

43  : bool
44  {
45  $not_id = $ilADNNotification->getId();
46  $usr_id = $ilObjUser->getId();
47  if (!isset(self::$request_cache[$usr_id][$not_id])) {
48  self::$request_cache[$usr_id][$not_id] = self::where(array(
49  'usr_id' => $usr_id,
50  'notification_id' => $not_id,
51  ))->hasSets();
52  }
53 
54  return (bool) self::$request_cache[$usr_id][$not_id];
55  }
int $usr_id
true integer 8
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ returnDbTableName()

static ilADNDismiss::returnDbTableName ( )
static
Deprecated:

Definition at line 36 of file class.ilADNDismiss.php.

36  : string
37  {
38  return self::TABLE_NAME;
39  }

◆ setId()

ilADNDismiss::setId ( int  $id)

Definition at line 104 of file class.ilADNDismiss.php.

References $id.

104  : void
105  {
106  $this->id = $id;
107  }
int $id
true true true integer 8 true

◆ setNotificationId()

ilADNDismiss::setNotificationId ( int  $notification_id)

Definition at line 124 of file class.ilADNDismiss.php.

References $notification_id.

124  : void
125  {
126  $this->notification_id = $notification_id;
127  }
int $notification_id
true integer 8

◆ setUsrId()

ilADNDismiss::setUsrId ( int  $usr_id)

Definition at line 114 of file class.ilADNDismiss.php.

References $usr_id.

114  : void
115  {
116  $this->usr_id = $usr_id;
117  }
int $usr_id
true integer 8

Field Documentation

◆ $id

int ilADNDismiss::$id = null
protected

true true true integer 8 true

Definition at line 85 of file class.ilADNDismiss.php.

Referenced by getId(), and setId().

◆ $notification_id

int ilADNDismiss::$notification_id = 0
protected

true integer 8

Definition at line 97 of file class.ilADNDismiss.php.

Referenced by getNotificationId(), and setNotificationId().

◆ $request_cache

array ilADNDismiss::$request_cache = array()
staticprotected

Definition at line 41 of file class.ilADNDismiss.php.

◆ $usr_id

int ilADNDismiss::$usr_id = 0
protected

true integer 8

Definition at line 91 of file class.ilADNDismiss.php.

Referenced by getUsrId(), hasDimissed(), and setUsrId().

◆ TABLE_NAME

const ilADNDismiss::TABLE_NAME = 'il_adn_dismiss'

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


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