ILIAS  release_8 Revision v8.24
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)
 
 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 ($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 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=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 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 ()
 
 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 = array(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_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 = array(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 23 of file class.ilADNNotification.php.

Member Function Documentation

◆ create()

ilADNNotification::create ( )

Reimplemented from ActiveRecord.

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

374 : void
375 {
376 global $DIC;
377 $this->setCreateDate(new DateTimeImmutable());
378 $this->setCreatedBy($DIC->user()->getId());
379 parent::create();
380 }
setCreateDate(DateTimeImmutable $create_date)
setCreatedBy(int $created_by)
global $DIC
Definition: feed.php:28

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

+ Here is the call graph for this function:

◆ dismiss()

ilADNNotification::dismiss ( ilObjUser  $ilObjUser)

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

54 : void
55 {
56 if ($this->isUserAllowedToDismiss($ilObjUser)) {
57 ilADNDismiss::dismiss($ilObjUser, $this);
58 }
59 }
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 101 of file class.ilADNNotification.php.

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 }

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

387 : string
388 {
389 return $this->body;
390 }
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 41 of file class.ilADNNotification.php.

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

References TABLE_NAME.

◆ getCreateDate()

ilADNNotification::getCreateDate ( )

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

525 : DateTimeImmutable
526 {
527 return $this->create_date ?? new DateTimeImmutable();
528 }

◆ getCreatedBy()

ilADNNotification::getCreatedBy ( )

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

535 : int
536 {
537 return (int) $this->created_by;
538 }
int $created_by
@con_has_field true @con_fieldtype integer @con_length 8

References $created_by.

◆ getDismissable()

ilADNNotification::getDismissable ( )

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

480 : bool
481 {
482 return $this->dismissable;
483 }
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 397 of file class.ilADNNotification.php.

397 : DateTimeImmutable
398 {
399 return $this->display_end ?? new DateTimeImmutable();
400 }

Referenced by hasDisplayEnded().

+ Here is the caller graph for this function:

◆ getDisplayStart()

ilADNNotification::getDisplayStart ( )

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

407 : DateTimeImmutable
408 {
409 return $this->display_start ?? new DateTimeImmutable();
410 }

Referenced by hasDisplayStarted().

+ Here is the caller graph for this function:

◆ getEventEnd()

ilADNNotification::getEventEnd ( )

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

417 : DateTimeImmutable
418 {
419 return $this->event_end ?? new DateTimeImmutable();
420 }

Referenced by getFullTimeFormated(), and hasEventEnded().

+ Here is the caller graph for this function:

◆ getEventStart()

ilADNNotification::getEventStart ( )

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

427 : DateTimeImmutable
428 {
429 return $this->event_start ?? new DateTimeImmutable();
430 }

Referenced by getFullTimeFormated(), and hasEventStarted().

+ Here is the caller graph for this function:

◆ getFullTimeFormated()

ilADNNotification::getFullTimeFormated ( )

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

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

References getEventEnd(), and getEventStart().

+ Here is the call graph for this function:

◆ getId()

ilADNNotification::getId ( )

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

437 : int
438 {
439 return (int) $this->id;
440 }
int $id
@con_is_primary true @con_sequence true @con_is_unique true @con_has_field true @con_fieldtype intege...

References $id.

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

+ Here is the caller graph for this function:

◆ getLimitedToRoleIds()

ilADNNotification::getLimitedToRoleIds ( )

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

555 : array
556 {
558 }
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 540 of file class.ilADNNotification.php.

540 : DateTimeImmutable
541 {
542 return new DateTimeImmutable();
543 }

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

+ Here is the caller graph for this function:

◆ getTitle()

ilADNNotification::getTitle ( )

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

447 : string
448 {
449 return $this->title;
450 }
string $title
@con_has_field true @con_fieldtype text @con_length 256

References $title.

◆ getType()

ilADNNotification::getType ( )

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

457 : int
458 {
459 return $this->type;
460 }
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 467 of file class.ilADNNotification.php.

467 : int
468 {
469 return in_array(
470 $this->type_during_event,
471 [self::TYPE_WARNING, self::TYPE_ERROR, self::TYPE_INFO]
472 ) ? $this->type_during_event : self::TYPE_INFO;
473 }

References TYPE_INFO.

Referenced by getActiveType().

+ Here is the caller graph for this function:

◆ hasDisplayEnded()

ilADNNotification::hasDisplayEnded ( )
protected

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

500 : bool
501 {
502 return $this->getTime() > $this->getDisplayEnd();
503 }

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

490 : bool
491 {
492 return $this->getTime() > $this->getDisplayStart();
493 }

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

495 : bool
496 {
497 return $this->getTime() > $this->getEventEnd();
498 }

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

485 : bool
486 {
487 return $this->getTime() > $this->getEventStart();
488 }

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:

◆ hasUserDismissed()

ilADNNotification::hasUserDismissed ( ilObjUser  $ilObjUser)
protected

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

61 : bool
62 {
63 if (!$this->getDismissable()) {
64 return false;
65 }
66
67 return ilADNDismiss::hasDimissed($ilObjUser, $this);
68 }
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 545 of file class.ilADNNotification.php.

545 : bool
546 {
547 return $this->active;
548 }
bool $active
@con_has_field true @con_fieldtype integer @con_length 1

References $active.

◆ isDuringEvent()

ilADNNotification::isDuringEvent ( )

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

515 : bool
516 {
517 return $this->hasEventStarted() && !$this->hasEventEnded();
518 }

References hasEventEnded(), and hasEventStarted().

+ Here is the call graph for this function:

◆ isLimitToRoles()

ilADNNotification::isLimitToRoles ( )

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

565 : bool
566 {
568 }
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 510 of file class.ilADNNotification.php.

510 : bool
511 {
512 return $this->permanent;
513 }
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 96 of file class.ilADNNotification.php.

96 : bool
97 {
98 return ($this->getDismissable() && $user->getId() !== 0 && $user->getId() !== ANONYMOUS_USER_ID);
99 }
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 116 of file class.ilADNNotification.php.

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 }

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

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->isVisibleRoleUserRoles($ilObjUser);
142 }
hasUserDismissed(ilObjUser $ilObjUser)
isVisibleRoleUserRoles(ilObjUser $ilObjUser)

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

+ Here is the call graph for this function:

◆ isVisibleRoleUserRoles()

ilADNNotification::isVisibleRoleUserRoles ( ilObjUser  $ilObjUser)
protected

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

145 : bool
146 {
147 if (!$this->isLimitToRoles()) {
148 return true;
149 }
150 global $DIC;
151
152 if ($ilObjUser->getId() === 0 && in_array(0, $this->getLimitedToRoleIds())) {
153 return true;
154 }
155
156 return $DIC->rbac()->review()->isAssignedToAtLeastOneGivenRole(
157 $ilObjUser->getId(),
158 $this->getLimitedToRoleIds()
159 );
160 }

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:

◆ resetForAllUsers()

ilADNNotification::resetForAllUsers ( )

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

70 : void
71 {
72 foreach (ilADNDismiss::where(array('notification_id' => $this->getId()))->get() as $not) {
73 $not->delete();
74 }
75 }
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 49 of file class.ilADNNotification.php.

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

References TABLE_NAME.

◆ setActive()

ilADNNotification::setActive ( bool  $active)

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

550 : void
551 {
552 $this->active = $active;
553 }

References $active.

◆ setBody()

ilADNNotification::setBody ( string  $body)

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

382 : void
383 {
384 $this->body = $body;
385 }

References $body.

◆ setCreateDate()

ilADNNotification::setCreateDate ( DateTimeImmutable  $create_date)

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

520 : void
521 {
522 $this->create_date = $create_date;
523 }
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 530 of file class.ilADNNotification.php.

530 : void
531 {
532 $this->created_by = $created_by;
533 }

References $created_by.

Referenced by create().

+ Here is the caller graph for this function:

◆ setDismissable()

ilADNNotification::setDismissable ( bool  $dismissable)

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

475 : void
476 {
477 $this->dismissable = $dismissable;
478 }

References $dismissable.

◆ setDisplayEnd()

ilADNNotification::setDisplayEnd ( DateTimeImmutable  $display_end)

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

392 : void
393 {
394 $this->display_end = $display_end;
395 }
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 402 of file class.ilADNNotification.php.

402 : void
403 {
404 $this->display_start = $display_start;
405 }
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 412 of file class.ilADNNotification.php.

412 : void
413 {
414 $this->event_end = $event_end;
415 }
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 422 of file class.ilADNNotification.php.

422 : void
423 {
424 $this->event_start = $event_start;
425 }
DateTimeImmutable $event_start
@con_has_field true @con_fieldtype integer @con_length 8

References $event_start.

◆ setId()

ilADNNotification::setId ( int  $id)

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

432 : void
433 {
434 $this->id = $id;
435 }

References $id.

◆ setLimitedToRoleIds()

ilADNNotification::setLimitedToRoleIds ( array  $limited_to_role_ids)

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

560 : void
561 {
562 $this->limited_to_role_ids = $limited_to_role_ids;
563 }

References $limited_to_role_ids.

◆ setLimitToRoles()

ilADNNotification::setLimitToRoles ( bool  $limit_to_roles)

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

570 : void
571 {
572 $this->limit_to_roles = $limit_to_roles;
573 }

References $limit_to_roles.

◆ setPermanent()

ilADNNotification::setPermanent ( bool  $permanent)

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

505 : void
506 {
507 $this->permanent = $permanent;
508 }

References $permanent.

◆ setTitle()

ilADNNotification::setTitle ( string  $title)

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

442 : void
443 {
444 $this->title = $title;
445 }

References $title.

◆ setType()

ilADNNotification::setType ( int  $type)

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

452 : void
453 {
454 $this->type = $type;
455 }

References $type.

◆ setTypeDuringEvent()

ilADNNotification::setTypeDuringEvent ( int  $type_during_event)

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

462 : void
463 {
464 $this->type_during_event = $type_during_event;
465 }
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 314 of file class.ilADNNotification.php.

315 {
316 switch ($field_name) {
317 case 'event_start':
318 case 'event_end':
319 case 'display_end':
320 case 'display_start':
321 case 'create_date':
322 case 'last_update':
323 return (new DateTimeImmutable())->setTimestamp((int) $field_value);
324
325 case 'allowed_users':
326 if ($field_value === null) {
327 $array_unique = self::$allowed_user_ids;
328 } else {
329 $json_decode = json_decode($field_value, true);
330 if (!is_array($json_decode)) {
331 $json_decode = self::$allowed_user_ids;
332 }
333 $array_unique = array_unique($json_decode);
334 }
335
336 sort($array_unique);
337
338 return $array_unique;
339 case 'limited_to_role_ids':
340 return json_decode($field_value, true);
341 }
342 }

References $allowed_user_ids.

Field Documentation

◆ $active

bool ilADNNotification::$active = true
protected

@con_has_field true @con_fieldtype integer @con_length 1

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

Referenced by isActive(), and setActive().

◆ $allowed_user_ids

array ilADNNotification::$allowed_user_ids = array(0, 13, 6)
staticprotected

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

Referenced by wakeUp().

◆ $allowed_users

array ilADNNotification::$allowed_users = array(0, 6, 13)
protected

@con_has_field true @con_fieldtype text @con_length 256

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

◆ $body

string ilADNNotification::$body = ''
protected

@con_has_field true @con_fieldtype clob

Definition at line 181 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 247 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 259 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 223 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 205 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 199 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 193 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 187 of file class.ilADNNotification.php.

Referenced by setEventStart().

◆ $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 170 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 289 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 253 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 265 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 283 of file class.ilADNNotification.php.

Referenced by isLimitToRoles(), and setLimitToRoles().

◆ $limited_to_role_ids

array ilADNNotification::$limited_to_role_ids = []
protected

@con_has_field true @con_fieldtype text @con_length 256

Definition at line 277 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 295 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 307 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 301 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 241 of file class.ilADNNotification.php.

◆ $permanent

bool ilADNNotification::$permanent = true
protected

@con_has_field true @con_fieldtype integer @con_length 1

Definition at line 229 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 176 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 211 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 217 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.

Referenced by getConnectorContainerName(), and returnDbTableName().

◆ TIME_FORMAT

const ilADNNotification::TIME_FORMAT = 'H:i'

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

◆ TYPE_ERROR

◆ TYPE_INFO

◆ TYPE_WARNING


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