ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 @description Return the Name of your Connector Table More...
 
 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 ()
 @description 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 ()
 @depracated 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
 @con_is_primary true @con_sequence true @con_is_unique true @con_has_field true @con_fieldtype integer @con_length 8 More...
 
string $title = ''
 @con_has_field true @con_fieldtype text @con_length 256 More...
 
string $body = ''
 @con_has_field true @con_fieldtype clob More...
 
DateTimeImmutable $event_start = null
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
DateTimeImmutable $event_end = null
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
DateTimeImmutable $display_start = null
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
DateTimeImmutable $display_end = null
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
int $type = self::TYPE_INFO
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
int $type_during_event = self::TYPE_ERROR
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
bool $dismissable = true
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
bool $permanent = true
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
array $allowed_users = [0, 6, 13]
 @con_has_field true @con_fieldtype text @con_length 256 More...
 
int $parent_id = null
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
DateTimeImmutable $create_date = null
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
DateTimeImmutable $last_update
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
int $created_by = null
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
int $last_update_by = null
 @con_has_field true @con_fieldtype integer @con_length 8 More...
 
bool $active = true
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
array $limited_to_languages = []
 @con_has_field true @con_fieldtype text @con_length 256 More...
 
bool $has_language_limitation = false
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
array $limited_to_role_ids = []
 @con_has_field true @con_fieldtype text @con_length 256 More...
 
bool $limit_to_roles = false
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
bool $interruptive = false
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
string $link = ''
 @con_has_field true @con_fieldtype text @con_length 256 More...
 
int $link_type = self::LINK_TYPE_NONE
 @con_has_field true @con_fieldtype integer @con_length 1 More...
 
string $link_target = '_top'
 @con_has_field true @con_fieldtype text @con_length 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 ()
 @description Returns an instance of the instatiated calling active record (needs to be done in static methods) @TODO : 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 24 of file class.ilADNNotification.php.

Member Function Documentation

◆ create()

ilADNNotification::create ( )

Reimplemented from ActiveRecord.

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

402 : void
403 {
404 global $DIC;
405 $this->setCreateDate(new DateTimeImmutable());
406 $this->setCreatedBy($DIC->user()->getId());
407 parent::create();
408 }
setCreateDate(DateTimeImmutable $create_date)
setCreatedBy(int $created_by)
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

◆ dismiss()

ilADNNotification::dismiss ( ilObjUser  $ilObjUser)

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

56 : void
57 {
58 if ($this->isUserAllowedToDismiss($ilObjUser)) {
59 ilADNDismiss::dismiss($ilObjUser, $this);
60 }
61 }
static dismiss(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
isUserAllowedToDismiss(ilObjUser $user)

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

+ Here is the call graph for this function:

◆ getActiveType()

ilADNNotification::getActiveType ( )

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

102 : int
103 {
104 if ($this->isPermanent()) {
105 return $this->getType();
106 }
107 if ($this->hasEventStarted() && !$this->hasEventEnded()) {
108 return $this->getTypeDuringEvent();
109 }
110 if ($this->hasDisplayStarted() && !$this->hasDisplayEnded()) {
111 return $this->getType();
112 }
113 return self::TYPE_INFO;
114 }

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

+ Here is the call graph for this function:

◆ getBody()

ilADNNotification::getBody ( )

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

415 : string
416 {
417 return $this->body;
418 }
string $body
@con_has_field true @con_fieldtype clob

References $body.

◆ getConnectorContainerName()

ilADNNotification::getConnectorContainerName ( )

@description Return the Name of your Connector Table

Reimplemented from ActiveRecord.

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

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

References TABLE_NAME.

◆ getCreateDate()

ilADNNotification::getCreateDate ( )

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

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

◆ getCreatedBy()

ilADNNotification::getCreatedBy ( )

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

563 : int
564 {
565 return (int) $this->created_by;
566 }
int $created_by
@con_has_field true @con_fieldtype integer @con_length 8

References $created_by.

◆ getDismissable()

ilADNNotification::getDismissable ( )

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

508 : bool
509 {
510 return $this->dismissable;
511 }
bool $dismissable
@con_has_field true @con_fieldtype integer @con_length 1

References $dismissable.

Referenced by hasUserDismissed(), and isUserAllowedToDismiss().

+ Here is the caller graph for this function:

◆ getDisplayEnd()

ilADNNotification::getDisplayEnd ( )

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

425 : DateTimeImmutable
426 {
427 return $this->display_end ?? new DateTimeImmutable();
428 }

Referenced by hasDisplayEnded().

+ Here is the caller graph for this function:

◆ getDisplayStart()

ilADNNotification::getDisplayStart ( )

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

435 : DateTimeImmutable
436 {
437 return $this->display_start ?? new DateTimeImmutable();
438 }

Referenced by hasDisplayStarted().

+ Here is the caller graph for this function:

◆ getEventEnd()

ilADNNotification::getEventEnd ( )

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

445 : DateTimeImmutable
446 {
447 return $this->event_end ?? new DateTimeImmutable();
448 }

Referenced by getFullTimeFormated(), and hasEventEnded().

+ Here is the caller graph for this function:

◆ getEventStart()

ilADNNotification::getEventStart ( )

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

455 : DateTimeImmutable
456 {
457 return $this->event_start ?? new DateTimeImmutable();
458 }

Referenced by getFullTimeFormated(), and hasEventStarted().

+ Here is the caller graph for this function:

◆ getFullTimeFormated()

ilADNNotification::getFullTimeFormated ( )

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

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

References getEventEnd(), and getEventStart().

+ Here is the call graph for this function:

◆ getId()

ilADNNotification::getId ( )

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

465 : int
466 {
467 return (int) $this->id;
468 }
int $id
@con_is_primary true @con_sequence true @con_is_unique true @con_has_field true @con_fieldtype intege...

References $id.

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

+ Here is the caller graph for this function:

◆ getLimitedToLanguages()

ilADNNotification::getLimitedToLanguages ( )

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

583 : array
584 {
586 }
array $limited_to_languages
@con_has_field true @con_fieldtype text @con_length 256

References $limited_to_languages.

◆ getLimitedToRoleIds()

ilADNNotification::getLimitedToRoleIds ( )

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

603 : array
604 {
606 }
array $limited_to_role_ids
@con_has_field true @con_fieldtype text @con_length 256

References $limited_to_role_ids.

Referenced by isVisibleRoleUserRoles().

+ Here is the caller graph for this function:

◆ getTime()

ilADNNotification::getTime ( )
protected

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

568 : DateTimeImmutable
569 {
570 return new DateTimeImmutable();
571 }

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

+ Here is the caller graph for this function:

◆ getTitle()

ilADNNotification::getTitle ( )

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

475 : string
476 {
477 return $this->title;
478 }
string $title
@con_has_field true @con_fieldtype text @con_length 256

References $title.

Referenced by ilADNNotificationGUI\confirmDelete().

+ Here is the caller graph for this function:

◆ getType()

ilADNNotification::getType ( )

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

485 : int
486 {
487 return $this->type;
488 }
int $type
@con_has_field true @con_fieldtype integer @con_length 1

References $type.

Referenced by getActiveType().

+ Here is the caller graph for this function:

◆ getTypeDuringEvent()

ilADNNotification::getTypeDuringEvent ( )

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

495 : int
496 {
497 return in_array(
498 $this->type_during_event,
499 [self::TYPE_WARNING, self::TYPE_ERROR, self::TYPE_INFO]
500 ) ? $this->type_during_event : self::TYPE_INFO;
501 }

References TYPE_INFO.

Referenced by getActiveType().

+ Here is the caller graph for this function:

◆ hasDisplayEnded()

ilADNNotification::hasDisplayEnded ( )
protected

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

528 : bool
529 {
530 return $this->getTime() > $this->getDisplayEnd();
531 }

References getDisplayEnd(), and getTime().

Referenced by getActiveType(), and isVisible().

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

◆ hasDisplayStarted()

ilADNNotification::hasDisplayStarted ( )
protected

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

518 : bool
519 {
520 return $this->getTime() > $this->getDisplayStart();
521 }

References getDisplayStart(), and getTime().

Referenced by getActiveType(), and isVisible().

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

◆ hasEventEnded()

ilADNNotification::hasEventEnded ( )
protected

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

523 : bool
524 {
525 return $this->getTime() > $this->getEventEnd();
526 }

References getEventEnd(), and getTime().

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

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

◆ hasEventStarted()

ilADNNotification::hasEventStarted ( )
protected

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

513 : bool
514 {
515 return $this->getTime() > $this->getEventStart();
516 }

References getEventStart(), and getTime().

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

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

◆ hasLanguageLimitation()

ilADNNotification::hasLanguageLimitation ( )

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

593 : bool
594 {
596 }
bool $has_language_limitation
@con_has_field true @con_fieldtype integer @con_length 1

References $has_language_limitation.

Referenced by isVisibleToUserBasedOnLanguage().

+ Here is the caller graph for this function:

◆ hasUserDismissed()

ilADNNotification::hasUserDismissed ( ilObjUser  $ilObjUser)
protected

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

63 : bool
64 {
65 if (!$this->getDismissable()) {
66 return false;
67 }
68
69 return ilADNDismiss::hasDimissed($ilObjUser, $this);
70 }
static hasDimissed(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)

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

Referenced by isVisibleForUser().

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

◆ isActive()

ilADNNotification::isActive ( )

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

573 : bool
574 {
575 return $this->active;
576 }
bool $active
@con_has_field true @con_fieldtype integer @con_length 1

References $active.

◆ isDuringEvent()

ilADNNotification::isDuringEvent ( )

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

543 : bool
544 {
545 return $this->hasEventStarted() && !$this->hasEventEnded();
546 }

References hasEventEnded(), and hasEventStarted().

+ Here is the call graph for this function:

◆ isLimitToRoles()

ilADNNotification::isLimitToRoles ( )

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

613 : bool
614 {
616 }
bool $limit_to_roles
@con_has_field true @con_fieldtype integer @con_length 1

References $limit_to_roles.

Referenced by isVisibleRoleUserRoles().

+ Here is the caller graph for this function:

◆ isPermanent()

ilADNNotification::isPermanent ( )

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

538 : bool
539 {
540 return $this->permanent;
541 }
bool $permanent
@con_has_field true @con_fieldtype integer @con_length 1

References $permanent.

Referenced by getActiveType(), and isVisible().

+ Here is the caller graph for this function:

◆ isUserAllowedToDismiss()

ilADNNotification::isUserAllowedToDismiss ( ilObjUser  $user)

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

97 : bool
98 {
99 return ($this->getDismissable() && $user->getId() !== 0 && $user->getId() !== ANONYMOUS_USER_ID);
100 }
const ANONYMOUS_USER_ID
Definition: constants.php:27

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

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

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

◆ isVisible()

ilADNNotification::isVisible ( )
protected

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

117 : bool
118 {
119 if ($this->isPermanent()) {
120 return true;
121 }
122 $hasEventStarted = $this->hasEventStarted();
123 $hasDisplayStarted = $this->hasDisplayStarted();
124 $hasEventEnded = !$this->hasEventEnded();
125 $hasDisplayEnded = !$this->hasDisplayEnded();
126
127 return ($hasEventStarted || $hasDisplayStarted)
128 && ($hasEventEnded || $hasDisplayEnded);
129 }

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

Referenced by isVisibleForUser().

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

◆ isVisibleForUser()

ilADNNotification::isVisibleForUser ( ilObjUser  $ilObjUser)

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

131 : bool
132 {
133 if ($ilObjUser->getId() === 0 && $this->interruptive) {
134 return false;
135 }
136 if (!$this->isVisible()) {
137 return false;
138 }
139 if ($this->hasUserDismissed($ilObjUser)) {
140 return false;
141 }
142 return ($this->isVisibleToUserBasedOnLanguage($ilObjUser) && $this->isVisibleRoleUserRoles($ilObjUser));
143 }
hasUserDismissed(ilObjUser $ilObjUser)
isVisibleRoleUserRoles(ilObjUser $ilObjUser)
isVisibleToUserBasedOnLanguage(ilObjUser $ilObjUser)

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

+ Here is the call graph for this function:

◆ isVisibleRoleUserRoles()

ilADNNotification::isVisibleRoleUserRoles ( ilObjUser  $ilObjUser)
protected

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

156 : bool
157 {
158 if (!$this->isLimitToRoles()) {
159 return true;
160 }
161 global $DIC;
162
163 if ($ilObjUser->getId() === 0 && in_array(0, $this->getLimitedToRoleIds())) {
164 return true;
165 }
166
167 return $DIC->rbac()->review()->isAssignedToAtLeastOneGivenRole(
168 $ilObjUser->getId(),
169 $this->getLimitedToRoleIds()
170 );
171 }

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

Referenced by isVisibleForUser().

+ 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 146 of file class.ilADNNotification.php.

146 : bool
147 {
148 if (!$this->hasLanguageLimitation()) {
149 return true;
150 }
151
152 return in_array($ilObjUser->getLanguage(), $this->getLimitedToLanguages(), true);
153 }

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

Referenced by isVisibleForUser().

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

◆ resetForAllUsers()

ilADNNotification::resetForAllUsers ( )

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

72 : void
73 {
74 foreach (ilADNDismiss::where(['notification_id' => $this->getId()])->get() as $not) {
75 $not->delete();
76 }
77 }
static where($where, $operator=null)

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

+ Here is the call graph for this function:

◆ returnDbTableName()

static ilADNNotification::returnDbTableName ( )
static
Deprecated:

Reimplemented from ActiveRecord.

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

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

References TABLE_NAME.

◆ setActive()

ilADNNotification::setActive ( bool  $active)

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

578 : void
579 {
580 $this->active = $active;
581 }

References $active.

◆ setBody()

ilADNNotification::setBody ( string  $body)

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

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

References $body.

◆ setCreateDate()

ilADNNotification::setCreateDate ( DateTimeImmutable  $create_date)

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

548 : void
549 {
550 $this->create_date = $create_date;
551 }
DateTimeImmutable $create_date
@con_has_field true @con_fieldtype integer @con_length 8

References $create_date.

Referenced by create().

+ Here is the caller graph for this function:

◆ setCreatedBy()

ilADNNotification::setCreatedBy ( int  $created_by)

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

558 : void
559 {
560 $this->created_by = $created_by;
561 }

References $created_by.

Referenced by create().

+ Here is the caller graph for this function:

◆ setDismissable()

ilADNNotification::setDismissable ( bool  $dismissable)

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

503 : void
504 {
505 $this->dismissable = $dismissable;
506 }

References $dismissable.

◆ setDisplayEnd()

ilADNNotification::setDisplayEnd ( DateTimeImmutable  $display_end)

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

420 : void
421 {
422 $this->display_end = $display_end;
423 }
DateTimeImmutable $display_end
@con_has_field true @con_fieldtype integer @con_length 8

References $display_end.

◆ setDisplayStart()

ilADNNotification::setDisplayStart ( DateTimeImmutable  $display_start)

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

430 : void
431 {
432 $this->display_start = $display_start;
433 }
DateTimeImmutable $display_start
@con_has_field true @con_fieldtype integer @con_length 8

References $display_start.

◆ setEventEnd()

ilADNNotification::setEventEnd ( DateTimeImmutable  $event_end)

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

440 : void
441 {
442 $this->event_end = $event_end;
443 }
DateTimeImmutable $event_end
@con_has_field true @con_fieldtype integer @con_length 8

References $event_end.

◆ setEventStart()

ilADNNotification::setEventStart ( DateTimeImmutable  $event_start)

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

450 : void
451 {
452 $this->event_start = $event_start;
453 }
DateTimeImmutable $event_start
@con_has_field true @con_fieldtype integer @con_length 8

References $event_start.

◆ setHasLanguageLimitation()

ilADNNotification::setHasLanguageLimitation ( bool  $has_language_limitation)

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

598 : void
599 {
600 $this->has_language_limitation = $has_language_limitation;
601 }

References $has_language_limitation.

◆ setId()

ilADNNotification::setId ( int  $id)

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

460 : void
461 {
462 $this->id = $id;
463 }

References $id.

◆ setLimitedToLanguages()

ilADNNotification::setLimitedToLanguages ( array  $limited_to_languages)

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

588 : void
589 {
590 $this->limited_to_languages = $limited_to_languages;
591 }

References $limited_to_languages.

◆ setLimitedToRoleIds()

ilADNNotification::setLimitedToRoleIds ( array  $limited_to_role_ids)

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

608 : void
609 {
610 $this->limited_to_role_ids = $limited_to_role_ids;
611 }

References $limited_to_role_ids.

◆ setLimitToRoles()

ilADNNotification::setLimitToRoles ( bool  $limit_to_roles)

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

618 : void
619 {
620 $this->limit_to_roles = $limit_to_roles;
621 }

References $limit_to_roles.

◆ setPermanent()

ilADNNotification::setPermanent ( bool  $permanent)

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

533 : void
534 {
535 $this->permanent = $permanent;
536 }

References $permanent.

◆ setTitle()

ilADNNotification::setTitle ( string  $title)

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

470 : void
471 {
472 $this->title = $title;
473 }

References $title.

◆ setType()

ilADNNotification::setType ( int  $type)

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

480 : void
481 {
482 $this->type = $type;
483 }

References $type.

◆ setTypeDuringEvent()

ilADNNotification::setTypeDuringEvent ( int  $type_during_event)

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

490 : void
491 {
492 $this->type_during_event = $type_during_event;
493 }
int $type_during_event
@con_has_field true @con_fieldtype integer @con_length 1

References $type_during_event.

◆ wakeUp()

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

Reimplemented from ActiveRecord.

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

338 {
339 switch ($field_name) {
340 case 'event_start':
341 case 'event_end':
342 case 'display_end':
343 case 'display_start':
344 case 'create_date':
345 case 'last_update':
346 return (new DateTimeImmutable())->setTimestamp((int) $field_value);
347
348 case 'allowed_users':
349 if ($field_value === null) {
350 $array_unique = self::$allowed_user_ids;
351 } else {
352 $json_decode = json_decode((string) $field_value, true);
353 if (!is_array($json_decode)) {
354 $json_decode = self::$allowed_user_ids;
355 }
356 $array_unique = array_unique($json_decode);
357 }
358
359 sort($array_unique);
360
361 return $array_unique;
362 case 'limited_to_languages':
363 case 'limited_to_role_ids':
364 return json_decode((string) $field_value, true);
365 }
366 return null;
367 }

References $allowed_user_ids, and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

+ Here is the call graph for this function:

Field Documentation

◆ $active

bool ilADNNotification::$active = true
protected

@con_has_field true @con_fieldtype integer @con_length 1

Definition at line 282 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 40 of file class.ilADNNotification.php.

Referenced by wakeUp().

◆ $allowed_users

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

@con_has_field true @con_fieldtype text @con_length 256

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

◆ $body

string ilADNNotification::$body = ''
protected

@con_has_field true @con_fieldtype clob

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

Referenced by getBody(), and setBody().

◆ $create_date

DateTimeImmutable ilADNNotification::$create_date = null
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

Referenced by setCreateDate().

◆ $created_by

int ilADNNotification::$created_by = null
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

Referenced by getCreatedBy(), and setCreatedBy().

◆ $dismissable

bool ilADNNotification::$dismissable = true
protected

@con_has_field true @con_fieldtype integer @con_length 1

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

Referenced by getDismissable(), and setDismissable().

◆ $display_end

DateTimeImmutable ilADNNotification::$display_end = null
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

Referenced by setDisplayEnd().

◆ $display_start

DateTimeImmutable ilADNNotification::$display_start = null
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

Referenced by setDisplayStart().

◆ $event_end

DateTimeImmutable ilADNNotification::$event_end = null
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

Referenced by setEventEnd().

◆ $event_start

DateTimeImmutable ilADNNotification::$event_start = null
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

Referenced by setEventStart().

◆ $has_language_limitation

bool ilADNNotification::$has_language_limitation = false
protected

@con_has_field true @con_fieldtype integer @con_length 1

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

Referenced by hasLanguageLimitation(), and setHasLanguageLimitation().

◆ $id

int ilADNNotification::$id = null
protected

@con_is_primary true @con_sequence true @con_is_unique true @con_has_field true @con_fieldtype integer @con_length 8

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

Referenced by getId(), and setId().

◆ $interruptive

bool ilADNNotification::$interruptive = false
protected

@con_has_field true @con_fieldtype integer @con_length 1

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

◆ $last_update

DateTimeImmutable ilADNNotification::$last_update
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

◆ $last_update_by

int ilADNNotification::$last_update_by = null
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

◆ $limit_to_roles

bool ilADNNotification::$limit_to_roles = false
protected

@con_has_field true @con_fieldtype integer @con_length 1

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

Referenced by isLimitToRoles(), and setLimitToRoles().

◆ $limited_to_languages

array ilADNNotification::$limited_to_languages = []
protected

@con_has_field true @con_fieldtype text @con_length 256

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

Referenced by getLimitedToLanguages(), and setLimitedToLanguages().

◆ $limited_to_role_ids

array ilADNNotification::$limited_to_role_ids = []
protected

@con_has_field true @con_fieldtype text @con_length 256

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

Referenced by getLimitedToRoleIds(), and setLimitedToRoleIds().

◆ $link

string ilADNNotification::$link = ''
protected

@con_has_field true @con_fieldtype text @con_length 256

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

◆ $link_target

string ilADNNotification::$link_target = '_top'
protected

@con_has_field true @con_fieldtype text @con_length 256

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

◆ $link_type

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

@con_has_field true @con_fieldtype integer @con_length 1

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

◆ $parent_id

int ilADNNotification::$parent_id = null
protected

@con_has_field true @con_fieldtype integer @con_length 8

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

◆ $permanent

bool ilADNNotification::$permanent = true
protected

@con_has_field true @con_fieldtype integer @con_length 1

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

Referenced by isPermanent(), and setPermanent().

◆ $title

string ilADNNotification::$title = ''
protected

@con_has_field true @con_fieldtype text @con_length 256

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

Referenced by getTitle(), and setTitle().

◆ $type

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

@con_has_field true @con_fieldtype integer @con_length 1

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

Referenced by getType(), and setType().

◆ $type_during_event

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

@con_has_field true @con_fieldtype integer @con_length 1

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

Referenced by setTypeDuringEvent().

◆ DATE_FORMAT

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

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

◆ DATE_TIME_FORMAT

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

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

◆ LINK_TYPE_NONE

const ilADNNotification::LINK_TYPE_NONE = 0

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

◆ LINK_TYPE_REF_ID

const ilADNNotification::LINK_TYPE_REF_ID = 1

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

◆ LINK_TYPE_URL

const ilADNNotification::LINK_TYPE_URL = 2

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

◆ POS_BOTTOM

const ilADNNotification::POS_BOTTOM = 4

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

◆ POS_RIGHT

const ilADNNotification::POS_RIGHT = 2

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

◆ POS_TOP

const ilADNNotification::POS_TOP = 1

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

◆ POST_LEFT

const ilADNNotification::POST_LEFT = 3

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

◆ TABLE_NAME

const ilADNNotification::TABLE_NAME = 'il_adn_notifications'

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

Referenced by getConnectorContainerName(), and returnDbTableName().

◆ TIME_FORMAT

const ilADNNotification::TIME_FORMAT = 'H:i'

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