ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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)
 
 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 ($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 ()
 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
 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 = array(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_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 = array(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 374 of file class.ilADNNotification.php.

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

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)
global $DIC
Definition: feed.php:28
setCreatedBy(int $created_by)
+ Here is the call graph for this function:

◆ dismiss()

ilADNNotification::dismiss ( ilObjUser  $ilObjUser)

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

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

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

References $body.

387  : string
388  {
389  return $this->body;
390  }

◆ getConnectorContainerName()

ilADNNotification::getConnectorContainerName ( )

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

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

◆ getCreateDate()

ilADNNotification::getCreateDate ( )

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

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

◆ getCreatedBy()

ilADNNotification::getCreatedBy ( )

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

References $created_by.

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

◆ getDismissable()

ilADNNotification::getDismissable ( )

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

References $dismissable.

Referenced by hasUserDismissed(), and isUserAllowedToDismiss().

480  : bool
481  {
482  return $this->dismissable;
483  }
bool $dismissable
true integer 1
+ Here is the caller graph for this function:

◆ getDisplayEnd()

ilADNNotification::getDisplayEnd ( )

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

Referenced by hasDisplayEnded().

398  {
399  return $this->display_end ?? new DateTimeImmutable();
400  }
+ Here is the caller graph for this function:

◆ getDisplayStart()

ilADNNotification::getDisplayStart ( )

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

Referenced by hasDisplayStarted().

408  {
409  return $this->display_start ?? new DateTimeImmutable();
410  }
+ Here is the caller graph for this function:

◆ getEventEnd()

ilADNNotification::getEventEnd ( )

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

Referenced by getFullTimeFormated(), and hasEventEnded().

418  {
419  return $this->event_end ?? new DateTimeImmutable();
420  }
+ Here is the caller graph for this function:

◆ getEventStart()

ilADNNotification::getEventStart ( )

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

Referenced by getFullTimeFormated(), and hasEventStarted().

428  {
429  return $this->event_start ?? new DateTimeImmutable();
430  }
+ Here is the caller graph for this function:

◆ getFullTimeFormated()

ilADNNotification::getFullTimeFormated ( )

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

References getEventEnd(), and getEventStart().

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  }
+ Here is the call graph for this function:

◆ getId()

ilADNNotification::getId ( )

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

References $id.

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

437  : int
438  {
439  return (int) $this->id;
440  }
int $id
true true true true integer 8
+ Here is the caller graph for this function:

◆ getLimitedToRoleIds()

ilADNNotification::getLimitedToRoleIds ( )

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

References $limited_to_role_ids.

Referenced by isVisibleRoleUserRoles().

555  : array
556  {
558  }
array $limited_to_role_ids
true text 256
+ Here is the caller graph for this function:

◆ getTime()

ilADNNotification::getTime ( )
protected

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

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

541  {
542  return new DateTimeImmutable();
543  }
+ Here is the caller graph for this function:

◆ getTitle()

ilADNNotification::getTitle ( )

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

References $title.

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

◆ getType()

ilADNNotification::getType ( )

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

References $type.

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

457  : int
458  {
459  return $this->type;
460  }
int $type
true integer 1
+ Here is the caller graph for this function:

◆ getTypeDuringEvent()

ilADNNotification::getTypeDuringEvent ( )

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

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

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  }
+ Here is the caller graph for this function:

◆ hasDisplayEnded()

ilADNNotification::hasDisplayEnded ( )
protected

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

References getDisplayEnd(), and getTime().

Referenced by getActiveType(), and isVisible().

500  : bool
501  {
502  return $this->getTime() > $this->getDisplayEnd();
503  }
+ 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.

References getDisplayStart(), and getTime().

Referenced by getActiveType(), and isVisible().

490  : bool
491  {
492  return $this->getTime() > $this->getDisplayStart();
493  }
+ 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.

References getEventEnd(), and getTime().

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

495  : bool
496  {
497  return $this->getTime() > $this->getEventEnd();
498  }
+ 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.

References getEventStart(), and getTime().

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

485  : bool
486  {
487  return $this->getTime() > $this->getEventStart();
488  }
+ 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.

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

Referenced by isVisibleForUser().

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)
+ 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.

References $active.

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

◆ isDuringEvent()

ilADNNotification::isDuringEvent ( )

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

References hasEventEnded(), and hasEventStarted().

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

515  : bool
516  {
517  return $this->hasEventStarted() && !$this->hasEventEnded();
518  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLimitToRoles()

ilADNNotification::isLimitToRoles ( )

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

References $limit_to_roles.

Referenced by isVisibleRoleUserRoles().

565  : bool
566  {
567  return $this->limit_to_roles;
568  }
bool $limit_to_roles
true integer 1
+ Here is the caller graph for this function:

◆ isPermanent()

ilADNNotification::isPermanent ( )

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

References $permanent.

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

510  : bool
511  {
512  return $this->permanent;
513  }
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(), and isVisibleRoleUserRoles().

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)
bool $interruptive
true integer 1
isVisibleRoleUserRoles(ilObjUser $ilObjUser)
+ Here is the call graph for this function:

◆ isVisibleRoleUserRoles()

ilADNNotification::isVisibleRoleUserRoles ( ilObjUser  $ilObjUser)
protected

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

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

Referenced by isVisibleForUser().

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  }
global $DIC
Definition: feed.php:28
+ 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.

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

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)
+ Here is the call graph for this function:

◆ returnDbTableName()

static ilADNNotification::returnDbTableName ( )
static
Deprecated:

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

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

◆ setActive()

ilADNNotification::setActive ( bool  $active)

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

References $active.

550  : void
551  {
552  $this->active = $active;
553  }
bool $active
true integer 1

◆ setBody()

ilADNNotification::setBody ( string  $body)

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

References $body.

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

◆ setCreateDate()

ilADNNotification::setCreateDate ( DateTimeImmutable  $create_date)

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

References $create_date.

Referenced by create().

520  : void
521  {
522  $this->create_date = $create_date;
523  }
DateTimeImmutable $create_date
true integer 8
+ Here is the caller graph for this function:

◆ setCreatedBy()

ilADNNotification::setCreatedBy ( int  $created_by)

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

References $created_by.

Referenced by create().

530  : void
531  {
532  $this->created_by = $created_by;
533  }
int $created_by
true integer 8
+ Here is the caller graph for this function:

◆ setDismissable()

ilADNNotification::setDismissable ( bool  $dismissable)

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

References $dismissable.

475  : void
476  {
477  $this->dismissable = $dismissable;
478  }
bool $dismissable
true integer 1

◆ setDisplayEnd()

ilADNNotification::setDisplayEnd ( DateTimeImmutable  $display_end)

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

References $display_end.

392  : void
393  {
394  $this->display_end = $display_end;
395  }
DateTimeImmutable $display_end
true integer 8

◆ setDisplayStart()

ilADNNotification::setDisplayStart ( DateTimeImmutable  $display_start)

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

References $display_start.

402  : void
403  {
404  $this->display_start = $display_start;
405  }
DateTimeImmutable $display_start
true integer 8

◆ setEventEnd()

ilADNNotification::setEventEnd ( DateTimeImmutable  $event_end)

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

References $event_end.

412  : void
413  {
414  $this->event_end = $event_end;
415  }
DateTimeImmutable $event_end
true integer 8

◆ setEventStart()

ilADNNotification::setEventStart ( DateTimeImmutable  $event_start)

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

References $event_start.

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

◆ setId()

ilADNNotification::setId ( int  $id)

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

References $id.

432  : void
433  {
434  $this->id = $id;
435  }
int $id
true true true true integer 8

◆ setLimitedToRoleIds()

ilADNNotification::setLimitedToRoleIds ( array  $limited_to_role_ids)

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

References $limited_to_role_ids.

560  : void
561  {
562  $this->limited_to_role_ids = $limited_to_role_ids;
563  }
array $limited_to_role_ids
true text 256

◆ setLimitToRoles()

ilADNNotification::setLimitToRoles ( bool  $limit_to_roles)

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

References $limit_to_roles.

570  : void
571  {
572  $this->limit_to_roles = $limit_to_roles;
573  }
bool $limit_to_roles
true integer 1

◆ setPermanent()

ilADNNotification::setPermanent ( bool  $permanent)

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

References $permanent.

505  : void
506  {
507  $this->permanent = $permanent;
508  }
bool $permanent
true integer 1

◆ setTitle()

ilADNNotification::setTitle ( string  $title)

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

References $title.

442  : void
443  {
444  $this->title = $title;
445  }
string $title
true text 256

◆ setType()

ilADNNotification::setType ( int  $type)

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

References $type.

452  : void
453  {
454  $this->type = $type;
455  }
int $type
true integer 1

◆ setTypeDuringEvent()

ilADNNotification::setTypeDuringEvent ( int  $type_during_event)

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

References $type_during_event.

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

References ILIAS\Repository\int(), and ActiveRecord\sleep().

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  }
+ Here is the call graph for this function:

Field Documentation

◆ $active

bool ilADNNotification::$active = true
protected

true integer 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.

◆ $allowed_users

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

true text 256

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

◆ $body

string ilADNNotification::$body = ''
protected

true clob

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

Referenced by getBody(), and setBody().

◆ $create_date

DateTimeImmutable ilADNNotification::$create_date = null
protected

true integer 8

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

Referenced by setCreateDate().

◆ $created_by

int ilADNNotification::$created_by = null
protected

true integer 8

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

Referenced by getCreatedBy(), and setCreatedBy().

◆ $dismissable

bool ilADNNotification::$dismissable = true
protected

true integer 1

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

Referenced by getDismissable(), and setDismissable().

◆ $display_end

DateTimeImmutable ilADNNotification::$display_end = null
protected

true integer 8

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

Referenced by setDisplayEnd().

◆ $display_start

DateTimeImmutable ilADNNotification::$display_start = null
protected

true integer 8

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

Referenced by setDisplayStart().

◆ $event_end

DateTimeImmutable ilADNNotification::$event_end = null
protected

true integer 8

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

Referenced by setEventEnd().

◆ $event_start

DateTimeImmutable ilADNNotification::$event_start = null
protected

true integer 8

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

Referenced by setEventStart().

◆ $id

int ilADNNotification::$id = null
protected

true true true true integer 8

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

Referenced by getId(), and setId().

◆ $interruptive

bool ilADNNotification::$interruptive = false
protected

true integer 1

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

Referenced by isVisibleForUser().

◆ $last_update

DateTimeImmutable ilADNNotification::$last_update
protected

true integer 8

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

◆ $last_update_by

int ilADNNotification::$last_update_by = null
protected

true integer 8

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

◆ $limit_to_roles

bool ilADNNotification::$limit_to_roles = false
protected

true integer 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

true text 256

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

Referenced by getLimitedToRoleIds(), and setLimitedToRoleIds().

◆ $link

string ilADNNotification::$link = ''
protected

true text 256

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

◆ $link_target

string ilADNNotification::$link_target = '_top'
protected

true text 256

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

◆ $link_type

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

true integer 1

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

◆ $parent_id

int ilADNNotification::$parent_id = null
protected

true integer 8

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

◆ $permanent

bool ilADNNotification::$permanent = true
protected

true integer 1

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

Referenced by isPermanent(), and setPermanent().

◆ $title

string ilADNNotification::$title = ''
protected

true text 256

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

Referenced by getTitle(), and setTitle().

◆ $type

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

true integer 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

true integer 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.

◆ 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: