ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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 (mixed $primary_key=0)
 
 storeObjectToCache ()
 
 asStdClass ()
 
 asArray ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, string $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=[])
 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=[])
 
static where ($where, $operator=null)
 
static innerjoinAR (ActiveRecord $activeRecord, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static innerjoin (string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static leftjoin (string $tablename, $on_this, string $on_external, array $fields=[' *'], string $operator='=', bool $both_external=false)
 
static orderBy (string $orderBy, string $orderDirection='ASC')
 
static dateFormat (string $date_format='d.m.Y - H:i:s')
 
static limit (int $start, int $end)
 
static affectedRows ()
 
static count ()
 
static get ()
 
static debug ()
 
static first ()
 
static getCollection ()
 
static last ()
 
static getFirstFromLastQuery ()
 
static connector (arConnector $arConnector)
 
static raw (bool $set_raw=true)
 
static getArray (?string $key=null, string|array|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 = []
 

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 58 of file class.ilADNDismiss.php.

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

Referenced by ilADNNotification\dismiss().

58  : void
59  {
60  if (!self::hasDimissed($ilObjUser, $ilADNNotification) && $ilADNNotification->isUserAllowedToDismiss($ilObjUser)) {
61  $obj = new self();
62  $obj->setNotificationId($ilADNNotification->getId());
63  $obj->setUsrId($ilObjUser->getId());
64  $obj->create();
65  }
66  }
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 29 of file class.ilADNDismiss.php.

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

◆ getId()

ilADNDismiss::getId ( )

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

References $id.

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

◆ getNotificationId()

ilADNDismiss::getNotificationId ( )

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

References $notification_id.

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

◆ getUsrId()

ilADNDismiss::getUsrId ( )

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

References $usr_id.

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

◆ hasDimissed()

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

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

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

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

44  : bool
45  {
46  $not_id = $ilADNNotification->getId();
47  $usr_id = $ilObjUser->getId();
48  if (!isset(self::$request_cache[$usr_id][$not_id])) {
49  self::$request_cache[$usr_id][$not_id] = self::where([
50  'usr_id' => $usr_id,
51  'notification_id' => $not_id,
52  ])->hasSets();
53  }
54 
55  return (bool) self::$request_cache[$usr_id][$not_id];
56  }
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 37 of file class.ilADNDismiss.php.

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

◆ setId()

ilADNDismiss::setId ( int  $id)

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

References $id.

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

◆ setNotificationId()

ilADNDismiss::setNotificationId ( int  $notification_id)

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

References $notification_id.

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

◆ setUsrId()

ilADNDismiss::setUsrId ( int  $usr_id)

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

References $usr_id.

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

Field Documentation

◆ $id

int ilADNDismiss::$id = null
protected

true true true integer 8 true

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

Referenced by getId(), and setId().

◆ $notification_id

int ilADNDismiss::$notification_id = 0
protected

true integer 8

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

Referenced by getNotificationId(), and setNotificationId().

◆ $request_cache

array ilADNDismiss::$request_cache = []
staticprotected

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

◆ $usr_id

int ilADNDismiss::$usr_id = 0
protected

true integer 8

Definition at line 92 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: