ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilADNNotification 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 ilADNNotification:
+ Collaboration diagram for ilADNNotification:

Public Member Functions

 getConnectorContainerName ()
 
 dismiss (ilObjUser $ilObjUser)
 
 resetForAllUsers ()
 
 getFullTimeFormated ()
 
 isUserAllowedToDismiss (ilObjUser $user)
 
 getActiveType ()
 
 isVisibleForUser (ilObjUser $ilObjUser)
 
 wakeUp ($field_name, $field_value)
 
 create ()
 
 setBody (string $body)
 
 getBody ()
 
 setDisplayEnd (DateTimeImmutable $display_end)
 
 getDisplayEnd ()
 
 setDisplayStart (DateTimeImmutable $display_start)
 
 getDisplayStart ()
 
 setEventEnd (DateTimeImmutable $event_end)
 
 getEventEnd ()
 
 setEventStart (DateTimeImmutable $event_start)
 
 getEventStart ()
 
 setId (int $id)
 
 getId ()
 
 setTitle (string $title)
 
 getTitle ()
 
 setType (int $type)
 
 getType ()
 
 setTypeDuringEvent (int $type_during_event)
 
 getTypeDuringEvent ()
 
 setDismissable (bool $dismissable)
 
 getDismissable ()
 
 setPermanent (bool $permanent)
 
 isPermanent ()
 
 isDuringEvent ()
 
 setCreateDate (DateTimeImmutable $create_date)
 
 getCreateDate ()
 
 setCreatedBy (int $created_by)
 
 getCreatedBy ()
 
 isActive ()
 
 setActive (bool $active)
 
 getLimitedToLanguages ()
 
 setLimitedToLanguages (array $limited_to_languages)
 
 hasLanguageLimitation ()
 
 setHasLanguageLimitation (bool $has_language_limitation)
 
 getLimitedToRoleIds ()
 
 setLimitedToRoleIds (array $limited_to_role_ids)
 
 isLimitToRoles ()
 
 setLimitToRoles (bool $limit_to_roles)
 
- 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 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 POS_TOP = 1
 
const POS_RIGHT = 2
 
const POST_LEFT = 3
 
const POS_BOTTOM = 4
 
const DATE_FORMAT = 'd.m.Y'
 
const TIME_FORMAT = 'H:i'
 
const DATE_TIME_FORMAT = 'd.m.Y H:i'
 
const TYPE_INFO = 1
 
const TYPE_WARNING = 2
 
const TYPE_ERROR = 3
 
const TABLE_NAME = 'il_adn_notifications'
 
const LINK_TYPE_NONE = 0
 
const LINK_TYPE_REF_ID = 1
 
const LINK_TYPE_URL = 2
 

Protected Member Functions

 hasUserDismissed (ilObjUser $ilObjUser)
 
 isVisible ()
 
 isVisibleToUserBasedOnLanguage (ilObjUser $ilObjUser)
 
 isVisibleRoleUserRoles (ilObjUser $ilObjUser)
 
 hasEventStarted ()
 
 hasDisplayStarted ()
 
 hasEventEnded ()
 
 hasDisplayEnded ()
 
 getTime ()
 
- Protected Member Functions inherited from ActiveRecord
 installDatabase ()
 

Protected Attributes

int $id = null
 true true true true integer 8 More...
 
string $title = ''
 true text 256 More...
 
string $body = ''
 true clob More...
 
DateTimeImmutable $event_start = null
 true integer 8 More...
 
DateTimeImmutable $event_end = null
 true integer 8 More...
 
DateTimeImmutable $display_start = null
 true integer 8 More...
 
DateTimeImmutable $display_end = null
 true integer 8 More...
 
int $type = self::TYPE_INFO
 true integer 1 More...
 
int $type_during_event = self::TYPE_ERROR
 true integer 1 More...
 
bool $dismissable = true
 true integer 1 More...
 
bool $permanent = true
 true integer 1 More...
 
array $allowed_users = [0, 6, 13]
 true text 256 More...
 
int $parent_id = null
 true integer 8 More...
 
DateTimeImmutable $create_date = null
 true integer 8 More...
 
DateTimeImmutable $last_update
 true integer 8 More...
 
int $created_by = null
 true integer 8 More...
 
int $last_update_by = null
 true integer 8 More...
 
bool $active = true
 true integer 1 More...
 
array $limited_to_languages = []
 true text 256 More...
 
bool $has_language_limitation = false
 true integer 1 More...
 
array $limited_to_role_ids = []
 true text 256 More...
 
bool $limit_to_roles = false
 true integer 1 More...
 
bool $interruptive = false
 true integer 1 More...
 
string $link = ''
 true text 256 More...
 
int $link_type = self::LINK_TYPE_NONE
 true integer 1 More...
 
string $link_target = '_top'
 true text 256 More...
 
- Protected Attributes inherited from ActiveRecord
bool $ar_safe_read = true
 
string $connector_container_name = ''
 
bool $is_new = true
 

Static Protected Attributes

static array $allowed_user_ids = [0, 13, 6]
 

Additional Inherited Members

- 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 ilADNNotification

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

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

Member Function Documentation

◆ create()

ilADNNotification::create ( )

Definition at line 401 of file class.ilADNNotification.php.

References $DIC, setCreateDate(), and setCreatedBy().

401  : void
402  {
403  global $DIC;
404  $this->setCreateDate(new DateTimeImmutable());
405  $this->setCreatedBy($DIC->user()->getId());
406  parent::create();
407  }
setCreateDate(DateTimeImmutable $create_date)
global $DIC
Definition: shib_login.php:22
setCreatedBy(int $created_by)
+ Here is the call graph for this function:

◆ dismiss()

ilADNNotification::dismiss ( ilObjUser  $ilObjUser)

Definition at line 55 of file class.ilADNNotification.php.

References ilADNDismiss\dismiss(), and isUserAllowedToDismiss().

55  : void
56  {
57  if ($this->isUserAllowedToDismiss($ilObjUser)) {
58  ilADNDismiss::dismiss($ilObjUser, $this);
59  }
60  }
static dismiss(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
isUserAllowedToDismiss(ilObjUser $user)
+ Here is the call graph for this function:

◆ getActiveType()

ilADNNotification::getActiveType ( )

Definition at line 101 of file class.ilADNNotification.php.

References getType(), getTypeDuringEvent(), hasDisplayEnded(), hasDisplayStarted(), hasEventEnded(), hasEventStarted(), and isPermanent().

101  : int
102  {
103  if ($this->isPermanent()) {
104  return $this->getType();
105  }
106  if ($this->hasEventStarted() && !$this->hasEventEnded()) {
107  return $this->getTypeDuringEvent();
108  }
109  if ($this->hasDisplayStarted() && !$this->hasDisplayEnded()) {
110  return $this->getType();
111  }
112  return self::TYPE_INFO;
113  }
+ Here is the call graph for this function:

◆ getBody()

ilADNNotification::getBody ( )

Definition at line 414 of file class.ilADNNotification.php.

References $body.

414  : string
415  {
416  return $this->body;
417  }

◆ getConnectorContainerName()

ilADNNotification::getConnectorContainerName ( )

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

42  : string
43  {
44  return self::TABLE_NAME;
45  }

◆ getCreateDate()

ilADNNotification::getCreateDate ( )

Definition at line 552 of file class.ilADNNotification.php.

553  {
554  return $this->create_date ?? new DateTimeImmutable();
555  }

◆ getCreatedBy()

ilADNNotification::getCreatedBy ( )

Definition at line 562 of file class.ilADNNotification.php.

References $created_by.

562  : int
563  {
564  return (int) $this->created_by;
565  }
int $created_by
true integer 8

◆ getDismissable()

ilADNNotification::getDismissable ( )

Definition at line 507 of file class.ilADNNotification.php.

References $dismissable.

Referenced by hasUserDismissed(), and isUserAllowedToDismiss().

507  : bool
508  {
509  return $this->dismissable;
510  }
bool $dismissable
true integer 1
+ Here is the caller graph for this function:

◆ getDisplayEnd()

ilADNNotification::getDisplayEnd ( )

Definition at line 424 of file class.ilADNNotification.php.

Referenced by hasDisplayEnded().

425  {
426  return $this->display_end ?? new DateTimeImmutable();
427  }
+ Here is the caller graph for this function:

◆ getDisplayStart()

ilADNNotification::getDisplayStart ( )

Definition at line 434 of file class.ilADNNotification.php.

Referenced by hasDisplayStarted().

435  {
436  return $this->display_start ?? new DateTimeImmutable();
437  }
+ Here is the caller graph for this function:

◆ getEventEnd()

ilADNNotification::getEventEnd ( )

Definition at line 444 of file class.ilADNNotification.php.

Referenced by getFullTimeFormated(), and hasEventEnded().

445  {
446  return $this->event_end ?? new DateTimeImmutable();
447  }
+ Here is the caller graph for this function:

◆ getEventStart()

ilADNNotification::getEventStart ( )

Definition at line 454 of file class.ilADNNotification.php.

Referenced by getFullTimeFormated(), and hasEventStarted().

455  {
456  return $this->event_start ?? new DateTimeImmutable();
457  }
+ Here is the caller graph for this function:

◆ getFullTimeFormated()

ilADNNotification::getFullTimeFormated ( )

Definition at line 78 of file class.ilADNNotification.php.

References getEventEnd(), and getEventStart().

78  : string
79  {
80  if ($this->getEventStart() == 0 && $this->getEventEnd() == 0) {
81  return '';
82  }
83  if (date(self::DATE_FORMAT, $this->getEventStart()) === date(self::DATE_FORMAT, $this->getEventEnd())) {
84  return date(self::DATE_FORMAT, $this->getEventEnd()) . ', ' . date(
85  self::TIME_FORMAT,
86  $this->getEventStart()
87  ) . " - "
88  . date(self::TIME_FORMAT, $this->getEventEnd());
89  }
90  return date(self::DATE_TIME_FORMAT, $this->getEventStart()) . ' - ' . date(
91  self::DATE_TIME_FORMAT,
92  $this->getEventEnd()
93  );
94  }
+ Here is the call graph for this function:

◆ getId()

ilADNNotification::getId ( )

Definition at line 464 of file class.ilADNNotification.php.

References $id.

Referenced by ilADNNotificationGUI\confirmDelete(), ilADNDismiss\dismiss(), ilADNDismiss\hasDimissed(), and resetForAllUsers().

464  : int
465  {
466  return (int) $this->id;
467  }
int $id
true true true true integer 8
+ Here is the caller graph for this function:

◆ getLimitedToLanguages()

ilADNNotification::getLimitedToLanguages ( )

Definition at line 582 of file class.ilADNNotification.php.

References $limited_to_languages.

Referenced by isVisibleToUserBasedOnLanguage().

582  : array
583  {
585  }
array $limited_to_languages
true text 256
+ Here is the caller graph for this function:

◆ getLimitedToRoleIds()

ilADNNotification::getLimitedToRoleIds ( )

Definition at line 602 of file class.ilADNNotification.php.

References $limited_to_role_ids.

Referenced by isVisibleRoleUserRoles().

602  : array
603  {
605  }
array $limited_to_role_ids
true text 256
+ Here is the caller graph for this function:

◆ getTime()

ilADNNotification::getTime ( )
protected

Definition at line 567 of file class.ilADNNotification.php.

Referenced by hasDisplayEnded(), hasDisplayStarted(), hasEventEnded(), and hasEventStarted().

568  {
569  return new DateTimeImmutable();
570  }
+ Here is the caller graph for this function:

◆ getTitle()

ilADNNotification::getTitle ( )

Definition at line 474 of file class.ilADNNotification.php.

References $title.

Referenced by ilADNNotificationGUI\confirmDelete().

474  : string
475  {
476  return $this->title;
477  }
string $title
true text 256
+ Here is the caller graph for this function:

◆ getType()

ilADNNotification::getType ( )

Definition at line 484 of file class.ilADNNotification.php.

References $type.

Referenced by getActiveType(), and ILIAS\GlobalScreen\ADNProvider\handleDenotation().

484  : int
485  {
486  return $this->type;
487  }
int $type
true integer 1
+ Here is the caller graph for this function:

◆ getTypeDuringEvent()

ilADNNotification::getTypeDuringEvent ( )

Definition at line 494 of file class.ilADNNotification.php.

Referenced by getActiveType(), and ILIAS\GlobalScreen\ADNProvider\handleDenotation().

494  : int
495  {
496  return in_array(
497  $this->type_during_event,
498  [self::TYPE_WARNING, self::TYPE_ERROR, self::TYPE_INFO]
499  ) ? $this->type_during_event : self::TYPE_INFO;
500  }
+ Here is the caller graph for this function:

◆ hasDisplayEnded()

ilADNNotification::hasDisplayEnded ( )
protected

Definition at line 527 of file class.ilADNNotification.php.

References getDisplayEnd(), and getTime().

Referenced by getActiveType(), and isVisible().

527  : bool
528  {
529  return $this->getTime() > $this->getDisplayEnd();
530  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasDisplayStarted()

ilADNNotification::hasDisplayStarted ( )
protected

Definition at line 517 of file class.ilADNNotification.php.

References getDisplayStart(), and getTime().

Referenced by getActiveType(), and isVisible().

517  : bool
518  {
519  return $this->getTime() > $this->getDisplayStart();
520  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasEventEnded()

ilADNNotification::hasEventEnded ( )
protected

Definition at line 522 of file class.ilADNNotification.php.

References getEventEnd(), and getTime().

Referenced by getActiveType(), isDuringEvent(), and isVisible().

522  : bool
523  {
524  return $this->getTime() > $this->getEventEnd();
525  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasEventStarted()

ilADNNotification::hasEventStarted ( )
protected

Definition at line 512 of file class.ilADNNotification.php.

References getEventStart(), and getTime().

Referenced by getActiveType(), isDuringEvent(), and isVisible().

512  : bool
513  {
514  return $this->getTime() > $this->getEventStart();
515  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasLanguageLimitation()

ilADNNotification::hasLanguageLimitation ( )

Definition at line 592 of file class.ilADNNotification.php.

References $has_language_limitation.

Referenced by isVisibleToUserBasedOnLanguage().

592  : bool
593  {
595  }
bool $has_language_limitation
true integer 1
+ Here is the caller graph for this function:

◆ hasUserDismissed()

ilADNNotification::hasUserDismissed ( ilObjUser  $ilObjUser)
protected

Definition at line 62 of file class.ilADNNotification.php.

References getDismissable(), and ilADNDismiss\hasDimissed().

Referenced by isVisibleForUser().

62  : bool
63  {
64  if (!$this->getDismissable()) {
65  return false;
66  }
67 
68  return ilADNDismiss::hasDimissed($ilObjUser, $this);
69  }
static hasDimissed(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isActive()

ilADNNotification::isActive ( )

Definition at line 572 of file class.ilADNNotification.php.

References $active.

572  : bool
573  {
574  return $this->active;
575  }
bool $active
true integer 1

◆ isDuringEvent()

ilADNNotification::isDuringEvent ( )

Definition at line 542 of file class.ilADNNotification.php.

References hasEventEnded(), and hasEventStarted().

Referenced by ILIAS\GlobalScreen\ADNProvider\handleDenotation().

542  : bool
543  {
544  return $this->hasEventStarted() && !$this->hasEventEnded();
545  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLimitToRoles()

ilADNNotification::isLimitToRoles ( )

Definition at line 612 of file class.ilADNNotification.php.

References $limit_to_roles.

Referenced by isVisibleRoleUserRoles().

612  : bool
613  {
614  return $this->limit_to_roles;
615  }
bool $limit_to_roles
true integer 1
+ Here is the caller graph for this function:

◆ isPermanent()

ilADNNotification::isPermanent ( )

Definition at line 537 of file class.ilADNNotification.php.

References $permanent.

Referenced by getActiveType(), ILIAS\GlobalScreen\ADNProvider\handleDenotation(), and isVisible().

537  : bool
538  {
539  return $this->permanent;
540  }
bool $permanent
true integer 1
+ Here is the caller graph for this function:

◆ isUserAllowedToDismiss()

ilADNNotification::isUserAllowedToDismiss ( ilObjUser  $user)

Definition at line 96 of file class.ilADNNotification.php.

References ANONYMOUS_USER_ID, getDismissable(), and ilObject\getId().

Referenced by dismiss(), and ilADNDismiss\dismiss().

96  : bool
97  {
98  return ($this->getDismissable() && $user->getId() !== 0 && $user->getId() !== ANONYMOUS_USER_ID);
99  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVisible()

ilADNNotification::isVisible ( )
protected

Definition at line 116 of file class.ilADNNotification.php.

References hasDisplayEnded(), hasDisplayStarted(), hasEventEnded(), hasEventStarted(), and isPermanent().

Referenced by isVisibleForUser().

116  : bool
117  {
118  if ($this->isPermanent()) {
119  return true;
120  }
121  $hasEventStarted = $this->hasEventStarted();
122  $hasDisplayStarted = $this->hasDisplayStarted();
123  $hasEventEnded = !$this->hasEventEnded();
124  $hasDisplayEnded = !$this->hasDisplayEnded();
125 
126  return ($hasEventStarted || $hasDisplayStarted)
127  && ($hasEventEnded || $hasDisplayEnded);
128  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVisibleForUser()

ilADNNotification::isVisibleForUser ( ilObjUser  $ilObjUser)

Definition at line 130 of file class.ilADNNotification.php.

References $interruptive, ilObject\getId(), hasUserDismissed(), isVisible(), isVisibleRoleUserRoles(), and isVisibleToUserBasedOnLanguage().

130  : bool
131  {
132  if ($ilObjUser->getId() === 0 && $this->interruptive) {
133  return false;
134  }
135  if (!$this->isVisible()) {
136  return false;
137  }
138  if ($this->hasUserDismissed($ilObjUser)) {
139  return false;
140  }
141  return ($this->isVisibleToUserBasedOnLanguage($ilObjUser) && $this->isVisibleRoleUserRoles($ilObjUser));
142  }
hasUserDismissed(ilObjUser $ilObjUser)
bool $interruptive
true integer 1
isVisibleToUserBasedOnLanguage(ilObjUser $ilObjUser)
isVisibleRoleUserRoles(ilObjUser $ilObjUser)
+ Here is the call graph for this function:

◆ isVisibleRoleUserRoles()

ilADNNotification::isVisibleRoleUserRoles ( ilObjUser  $ilObjUser)
protected

Definition at line 155 of file class.ilADNNotification.php.

References $DIC, ilObject\getId(), getLimitedToRoleIds(), and isLimitToRoles().

Referenced by isVisibleForUser().

155  : bool
156  {
157  if (!$this->isLimitToRoles()) {
158  return true;
159  }
160  global $DIC;
161 
162  if ($ilObjUser->getId() === 0 && in_array(0, $this->getLimitedToRoleIds())) {
163  return true;
164  }
165 
166  return $DIC->rbac()->review()->isAssignedToAtLeastOneGivenRole(
167  $ilObjUser->getId(),
168  $this->getLimitedToRoleIds()
169  );
170  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVisibleToUserBasedOnLanguage()

ilADNNotification::isVisibleToUserBasedOnLanguage ( ilObjUser  $ilObjUser)
protected

Definition at line 145 of file class.ilADNNotification.php.

References ilObjUser\getLanguage(), getLimitedToLanguages(), and hasLanguageLimitation().

Referenced by isVisibleForUser().

145  : bool
146  {
147  if (!$this->hasLanguageLimitation()) {
148  return true;
149  }
150 
151  return in_array($ilObjUser->getLanguage(), $this->getLimitedToLanguages(), true);
152  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetForAllUsers()

ilADNNotification::resetForAllUsers ( )

Definition at line 71 of file class.ilADNNotification.php.

References getId(), and ActiveRecord\where().

71  : void
72  {
73  foreach (ilADNDismiss::where(['notification_id' => $this->getId()])->get() as $not) {
74  $not->delete();
75  }
76  }
static where($where, $operator=null)
+ Here is the call graph for this function:

◆ returnDbTableName()

static ilADNNotification::returnDbTableName ( )
static
Deprecated:

Definition at line 50 of file class.ilADNNotification.php.

50  : string
51  {
52  return self::TABLE_NAME;
53  }

◆ setActive()

ilADNNotification::setActive ( bool  $active)

Definition at line 577 of file class.ilADNNotification.php.

References $active.

577  : void
578  {
579  $this->active = $active;
580  }
bool $active
true integer 1

◆ setBody()

ilADNNotification::setBody ( string  $body)

Definition at line 409 of file class.ilADNNotification.php.

References $body.

409  : void
410  {
411  $this->body = $body;
412  }

◆ setCreateDate()

ilADNNotification::setCreateDate ( DateTimeImmutable  $create_date)

Definition at line 547 of file class.ilADNNotification.php.

References $create_date.

Referenced by create().

547  : void
548  {
549  $this->create_date = $create_date;
550  }
DateTimeImmutable $create_date
true integer 8
+ Here is the caller graph for this function:

◆ setCreatedBy()

ilADNNotification::setCreatedBy ( int  $created_by)

Definition at line 557 of file class.ilADNNotification.php.

References $created_by.

Referenced by create().

557  : void
558  {
559  $this->created_by = $created_by;
560  }
int $created_by
true integer 8
+ Here is the caller graph for this function:

◆ setDismissable()

ilADNNotification::setDismissable ( bool  $dismissable)

Definition at line 502 of file class.ilADNNotification.php.

References $dismissable.

502  : void
503  {
504  $this->dismissable = $dismissable;
505  }
bool $dismissable
true integer 1

◆ setDisplayEnd()

ilADNNotification::setDisplayEnd ( DateTimeImmutable  $display_end)

Definition at line 419 of file class.ilADNNotification.php.

References $display_end.

419  : void
420  {
421  $this->display_end = $display_end;
422  }
DateTimeImmutable $display_end
true integer 8

◆ setDisplayStart()

ilADNNotification::setDisplayStart ( DateTimeImmutable  $display_start)

Definition at line 429 of file class.ilADNNotification.php.

References $display_start.

429  : void
430  {
431  $this->display_start = $display_start;
432  }
DateTimeImmutable $display_start
true integer 8

◆ setEventEnd()

ilADNNotification::setEventEnd ( DateTimeImmutable  $event_end)

Definition at line 439 of file class.ilADNNotification.php.

References $event_end.

439  : void
440  {
441  $this->event_end = $event_end;
442  }
DateTimeImmutable $event_end
true integer 8

◆ setEventStart()

ilADNNotification::setEventStart ( DateTimeImmutable  $event_start)

Definition at line 449 of file class.ilADNNotification.php.

References $event_start.

449  : void
450  {
451  $this->event_start = $event_start;
452  }
DateTimeImmutable $event_start
true integer 8

◆ setHasLanguageLimitation()

ilADNNotification::setHasLanguageLimitation ( bool  $has_language_limitation)

Definition at line 597 of file class.ilADNNotification.php.

References $has_language_limitation.

597  : void
598  {
599  $this->has_language_limitation = $has_language_limitation;
600  }
bool $has_language_limitation
true integer 1

◆ setId()

ilADNNotification::setId ( int  $id)

Definition at line 459 of file class.ilADNNotification.php.

References $id.

459  : void
460  {
461  $this->id = $id;
462  }
int $id
true true true true integer 8

◆ setLimitedToLanguages()

ilADNNotification::setLimitedToLanguages ( array  $limited_to_languages)

Definition at line 587 of file class.ilADNNotification.php.

References $limited_to_languages.

587  : void
588  {
589  $this->limited_to_languages = $limited_to_languages;
590  }
array $limited_to_languages
true text 256

◆ setLimitedToRoleIds()

ilADNNotification::setLimitedToRoleIds ( array  $limited_to_role_ids)

Definition at line 607 of file class.ilADNNotification.php.

References $limited_to_role_ids.

607  : void
608  {
609  $this->limited_to_role_ids = $limited_to_role_ids;
610  }
array $limited_to_role_ids
true text 256

◆ setLimitToRoles()

ilADNNotification::setLimitToRoles ( bool  $limit_to_roles)

Definition at line 617 of file class.ilADNNotification.php.

References $limit_to_roles.

617  : void
618  {
619  $this->limit_to_roles = $limit_to_roles;
620  }
bool $limit_to_roles
true integer 1

◆ setPermanent()

ilADNNotification::setPermanent ( bool  $permanent)

Definition at line 532 of file class.ilADNNotification.php.

References $permanent.

532  : void
533  {
534  $this->permanent = $permanent;
535  }
bool $permanent
true integer 1

◆ setTitle()

ilADNNotification::setTitle ( string  $title)

Definition at line 469 of file class.ilADNNotification.php.

References $title.

469  : void
470  {
471  $this->title = $title;
472  }
string $title
true text 256

◆ setType()

ilADNNotification::setType ( int  $type)

Definition at line 479 of file class.ilADNNotification.php.

References $type.

479  : void
480  {
481  $this->type = $type;
482  }
int $type
true integer 1

◆ setTypeDuringEvent()

ilADNNotification::setTypeDuringEvent ( int  $type_during_event)

Definition at line 489 of file class.ilADNNotification.php.

References $type_during_event.

489  : void
490  {
491  $this->type_during_event = $type_during_event;
492  }
int $type_during_event
true integer 1

◆ wakeUp()

ilADNNotification::wakeUp (   $field_name,
  $field_value 
)
Parameters
string$field_name
mixed$field_value
Returns
int|mixed

Definition at line 336 of file class.ilADNNotification.php.

References $datetime, $user_id, ILIAS\Repository\int(), null, ActiveRecord\sleep(), and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

337  {
338  switch ($field_name) {
339  case 'event_start':
340  case 'event_end':
341  case 'display_end':
342  case 'display_start':
343  case 'create_date':
344  case 'last_update':
345  return (new DateTimeImmutable())->setTimestamp((int) $field_value);
346 
347  case 'allowed_users':
348  if ($field_value === null) {
349  $array_unique = self::$allowed_user_ids;
350  } else {
351  $json_decode = json_decode((string) $field_value, true);
352  if (!is_array($json_decode)) {
353  $json_decode = self::$allowed_user_ids;
354  }
355  $array_unique = array_unique($json_decode);
356  }
357 
358  sort($array_unique);
359 
360  return $array_unique;
361  case 'limited_to_languages':
362  case 'limited_to_role_ids':
363  return json_decode((string) $field_value, true);
364  }
365  return null;
366  }
sort()
description: > Example for rendering a Sort Glyph.
Definition: sort.php:41
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Field Documentation

◆ $active

bool ilADNNotification::$active = true
protected

true integer 1

Definition at line 281 of file class.ilADNNotification.php.

Referenced by isActive(), and setActive().

◆ $allowed_user_ids

array ilADNNotification::$allowed_user_ids = [0, 13, 6]
staticprotected

Definition at line 39 of file class.ilADNNotification.php.

◆ $allowed_users

array ilADNNotification::$allowed_users = [0, 6, 13]
protected

true text 256

Definition at line 245 of file class.ilADNNotification.php.

◆ $body

string ilADNNotification::$body = ''
protected

true clob

Definition at line 191 of file class.ilADNNotification.php.

Referenced by getBody(), and setBody().

◆ $create_date

DateTimeImmutable ilADNNotification::$create_date = null
protected

true integer 8

Definition at line 257 of file class.ilADNNotification.php.

Referenced by setCreateDate().

◆ $created_by

int ilADNNotification::$created_by = null
protected

true integer 8

Definition at line 269 of file class.ilADNNotification.php.

Referenced by getCreatedBy(), and setCreatedBy().

◆ $dismissable

bool ilADNNotification::$dismissable = true
protected

true integer 1

Definition at line 233 of file class.ilADNNotification.php.

Referenced by getDismissable(), and setDismissable().

◆ $display_end

DateTimeImmutable ilADNNotification::$display_end = null
protected

true integer 8

Definition at line 215 of file class.ilADNNotification.php.

Referenced by setDisplayEnd().

◆ $display_start

DateTimeImmutable ilADNNotification::$display_start = null
protected

true integer 8

Definition at line 209 of file class.ilADNNotification.php.

Referenced by setDisplayStart().

◆ $event_end

DateTimeImmutable ilADNNotification::$event_end = null
protected

true integer 8

Definition at line 203 of file class.ilADNNotification.php.

Referenced by setEventEnd().

◆ $event_start

DateTimeImmutable ilADNNotification::$event_start = null
protected

true integer 8

Definition at line 197 of file class.ilADNNotification.php.

Referenced by setEventStart().

◆ $has_language_limitation

bool ilADNNotification::$has_language_limitation = false
protected

true integer 1

Definition at line 293 of file class.ilADNNotification.php.

Referenced by hasLanguageLimitation(), and setHasLanguageLimitation().

◆ $id

int ilADNNotification::$id = null
protected

true true true true integer 8

Definition at line 180 of file class.ilADNNotification.php.

Referenced by getId(), and setId().

◆ $interruptive

bool ilADNNotification::$interruptive = false
protected

true integer 1

Definition at line 311 of file class.ilADNNotification.php.

Referenced by isVisibleForUser().

◆ $last_update

DateTimeImmutable ilADNNotification::$last_update
protected

true integer 8

Definition at line 263 of file class.ilADNNotification.php.

◆ $last_update_by

int ilADNNotification::$last_update_by = null
protected

true integer 8

Definition at line 275 of file class.ilADNNotification.php.

◆ $limit_to_roles

bool ilADNNotification::$limit_to_roles = false
protected

true integer 1

Definition at line 305 of file class.ilADNNotification.php.

Referenced by isLimitToRoles(), and setLimitToRoles().

◆ $limited_to_languages

array ilADNNotification::$limited_to_languages = []
protected

true text 256

Definition at line 287 of file class.ilADNNotification.php.

Referenced by getLimitedToLanguages(), and setLimitedToLanguages().

◆ $limited_to_role_ids

array ilADNNotification::$limited_to_role_ids = []
protected

true text 256

Definition at line 299 of file class.ilADNNotification.php.

Referenced by getLimitedToRoleIds(), and setLimitedToRoleIds().

◆ $link

string ilADNNotification::$link = ''
protected

true text 256

Definition at line 317 of file class.ilADNNotification.php.

◆ $link_target

string ilADNNotification::$link_target = '_top'
protected

true text 256

Definition at line 329 of file class.ilADNNotification.php.

◆ $link_type

int ilADNNotification::$link_type = self::LINK_TYPE_NONE
protected

true integer 1

Definition at line 323 of file class.ilADNNotification.php.

◆ $parent_id

int ilADNNotification::$parent_id = null
protected

true integer 8

Definition at line 251 of file class.ilADNNotification.php.

◆ $permanent

bool ilADNNotification::$permanent = true
protected

true integer 1

Definition at line 239 of file class.ilADNNotification.php.

Referenced by isPermanent(), and setPermanent().

◆ $title

string ilADNNotification::$title = ''
protected

true text 256

Definition at line 186 of file class.ilADNNotification.php.

Referenced by getTitle(), and setTitle().

◆ $type

int ilADNNotification::$type = self::TYPE_INFO
protected

true integer 1

Definition at line 221 of file class.ilADNNotification.php.

Referenced by getType(), and setType().

◆ $type_during_event

int ilADNNotification::$type_during_event = self::TYPE_ERROR
protected

true integer 1

Definition at line 227 of file class.ilADNNotification.php.

Referenced by setTypeDuringEvent().

◆ DATE_FORMAT

const ilADNNotification::DATE_FORMAT = 'd.m.Y'

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

◆ DATE_TIME_FORMAT

const ilADNNotification::DATE_TIME_FORMAT = 'd.m.Y H:i'

Definition at line 31 of file class.ilADNNotification.php.

◆ LINK_TYPE_NONE

const ilADNNotification::LINK_TYPE_NONE = 0

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

◆ LINK_TYPE_REF_ID

const ilADNNotification::LINK_TYPE_REF_ID = 1

Definition at line 37 of file class.ilADNNotification.php.

◆ LINK_TYPE_URL

const ilADNNotification::LINK_TYPE_URL = 2

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

◆ POS_BOTTOM

const ilADNNotification::POS_BOTTOM = 4

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

◆ POS_RIGHT

const ilADNNotification::POS_RIGHT = 2

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

◆ POS_TOP

const ilADNNotification::POS_TOP = 1

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

◆ POST_LEFT

const ilADNNotification::POST_LEFT = 3

Definition at line 27 of file class.ilADNNotification.php.

◆ TABLE_NAME

const ilADNNotification::TABLE_NAME = 'il_adn_notifications'

Definition at line 35 of file class.ilADNNotification.php.

◆ TIME_FORMAT

const ilADNNotification::TIME_FORMAT = 'H:i'

Definition at line 30 of file class.ilADNNotification.php.

◆ TYPE_ERROR

◆ TYPE_INFO

const ilADNNotification::TYPE_INFO = 1

◆ TYPE_WARNING


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