ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilADNNotification Class Reference

ALL More...

+ Inheritance diagram for ilADNNotification:
+ Collaboration diagram for ilADNNotification:

Public Member Functions

 getConnectorContainerName ()
 
 dismiss (ilObjUser $ilObjUser)
 
 resetForAllUsers ()
 
 getFullTimeFormated ()
 
 isUserAllowedToDismiss (ilObjUser $ilUser)
 
 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 ()
 
 setConnectorContainerName ($connector_container_name)
 
 getPrimaryFieldValue ()
 
 setPrimaryFieldValue ($value)
 
 __construct ($primary_key=0, arConnector $connector=null)
 
 storeObjectToCache ()
 
 __getConvertedDateFieldsAsArray ($format=null)
 
 __asCsv ($separator=';', $header=false)
 
 __asArray ()
 
 __asStdClass ()
 
 __asSerializedObject ()
 
 buildFromArray (array $array)
 
 fixDateField ($field_name, $value)
 
 sleep ($field_name)
 
 wakeUp ($field_name, $field_value)
 
 getArrayForDb ()
 
 getArrayForConnector ()
 
 installConnector ()
 
 store ()
 
 save ()
 
 create ()
 
 copy ($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 ($old_name, $new_name)
 
static tableExists ()
 
static fieldExists ($field_name)
 
static removeDBField ($field_name)
 
static updateDB ()
 
static resetDB ()
 
static truncateDB ()
 
static flushDB ()
 
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, $fields=array(' *'), $operator='=', $both_external=false)
 
static innerjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static leftjoin ($tablename, $on_this, $on_external, $fields=array(' *'), $operator='=', $both_external=false)
 
static orderBy ($orderBy, $orderDirection='ASC')
 
static dateFormat ($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 ($set_raw=true)
 
static getArray ($key=null, $values=null)
 
static _toCamelCase ($str, $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
 
- Data Fields inherited from ActiveRecord
const ACTIVE_RECORD_VERSION = '2.0.7'
 

Protected Member Functions

 hasUserDismissed (ilObjUser $ilObjUser)
 
 isVisible ()
 
 isVisibleRoleUserRoles (ilObjUser $ilObjUser)
 
 hasEventStarted ()
 
 hasDisplayStarted ()
 
 hasEventEnded ()
 
 hasDisplayEnded ()
 
 getTime ()
 
- Protected Member Functions inherited from ActiveRecord
 serializeToCSV ($field)
 This method is called for every field of your instance if you use __asCsv. More...
 
 installDatabase ()
 

Protected Attributes

 $id
 
 $title = ''
 
 $body = ''
 
 $event_start
 
 $event_end
 
 $display_start
 
 $display_end
 
 $type = self::TYPE_INFO
 
 $type_during_event = self::TYPE_ERROR
 
 $dismissable = true
 
 $permanent = true
 
 $allowed_users = array(0, 6, 13)
 
 $parent_id = null
 
 $create_date
 
 $last_update
 
 $created_by = null
 
 $last_update_by = null
 
 $active = true
 
 $limited_to_role_ids = []
 
 $limit_to_roles = false
 
 $interruptive = false
 
 $link = ''
 
 $link_type = self::LINK_TYPE_NONE
 
 $link_target = '_top'
 
- Protected Attributes inherited from ActiveRecord
 $ar_safe_read = true
 
 $connector_container_name = ''
 

Static Protected Attributes

static $allowed_user_ids = array(0, 13, 6)
 

Additional Inherited Members

- Static Protected Member Functions inherited from ActiveRecord
static getCalledClass ()
 
static fromCamelCase ($str)
 

Detailed Description

ALL

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

Member Function Documentation

◆ create()

ilADNNotification::create ( )

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

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

420  {
421  global $DIC;
422  $this->setCreateDate(new DateTimeImmutable());
423  $this->setCreatedBy($DIC->user()->getId());
424  parent::create();
425  }
setCreateDate(DateTimeImmutable $create_date)
global $DIC
Definition: goto.php:24
setCreatedBy(int $created_by)
+ Here is the call graph for this function:

◆ dismiss()

ilADNNotification::dismiss ( ilObjUser  $ilObjUser)
Parameters
ilObjUser$ilObjUser

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

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

51  {
52  if ($this->isUserAllowedToDismiss($ilObjUser)) {
53  ilADNDismiss::dismiss($ilObjUser, $this);
54  }
55  }
static dismiss(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
isUserAllowedToDismiss(ilObjUser $ilUser)
+ Here is the call graph for this function:

◆ getActiveType()

ilADNNotification::getActiveType ( )
Returns
int

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

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

108  {
109  if ($this->isPermanent()) {
110  return $this->getType();
111  }
112  if ($this->hasEventStarted() and !$this->hasEventEnded()) {
113  return $this->getTypeDuringEvent();
114  }
115  if ($this->hasDisplayStarted() and !$this->hasDisplayEnded()) {
116  return $this->getType();
117  }
118  }
+ Here is the call graph for this function:

◆ getBody()

ilADNNotification::getBody ( )

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

References $body.

432  : string
433  {
434  return (string) $this->body;
435  }

◆ getConnectorContainerName()

ilADNNotification::getConnectorContainerName ( )
Returns
string

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

34  {
35  return self::TABLE_NAME;
36  }

◆ getCreateDate()

ilADNNotification::getCreateDate ( )

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

568  {
569  return $this->create_date ?? new DateTimeImmutable();
570  }

◆ getCreatedBy()

ilADNNotification::getCreatedBy ( )

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

References $created_by.

577  : int
578  {
579  return (int) $this->created_by;
580  }

◆ getDismissable()

ilADNNotification::getDismissable ( )

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

References $dismissable.

Referenced by hasUserDismissed(), and isUserAllowedToDismiss().

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

◆ getDisplayEnd()

ilADNNotification::getDisplayEnd ( )

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

Referenced by hasDisplayEnded().

443  {
444  return $this->display_end ?? new DateTimeImmutable();
445  }
+ Here is the caller graph for this function:

◆ getDisplayStart()

ilADNNotification::getDisplayStart ( )

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

Referenced by hasDisplayStarted().

453  {
454  return $this->display_start ?? new DateTimeImmutable();
455  }
+ Here is the caller graph for this function:

◆ getEventEnd()

ilADNNotification::getEventEnd ( )

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

Referenced by getFullTimeFormated(), and hasEventEnded().

463  {
464  return $this->event_end ?? new DateTimeImmutable();
465  }
+ Here is the caller graph for this function:

◆ getEventStart()

ilADNNotification::getEventStart ( )

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

Referenced by getFullTimeFormated(), and hasEventStarted().

473  {
474  return $this->event_start ?? new DateTimeImmutable();
475  }
+ Here is the caller graph for this function:

◆ getFullTimeFormated()

ilADNNotification::getFullTimeFormated ( )
Returns
string

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

References getEventEnd(), and getEventStart().

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

◆ getId()

ilADNNotification::getId ( )

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

References $id.

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

482  : int
483  {
484  return (int) $this->id;
485  }
+ Here is the caller graph for this function:

◆ getLimitedToRoleIds()

ilADNNotification::getLimitedToRoleIds ( )

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

References $limited_to_role_ids.

Referenced by isVisibleRoleUserRoles().

597  : array
598  {
599  return (array) $this->limited_to_role_ids;
600  }
+ Here is the caller graph for this function:

◆ getTime()

ilADNNotification::getTime ( )
protected

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

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

583  {
584  return new DateTimeImmutable();
585  }
+ Here is the caller graph for this function:

◆ getTitle()

ilADNNotification::getTitle ( )

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

References $title.

492  : string
493  {
494  return (string) $this->title;
495  }

◆ getType()

ilADNNotification::getType ( )

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

References $type.

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

502  : int
503  {
504  return (int) $this->type;
505  }
+ Here is the caller graph for this function:

◆ getTypeDuringEvent()

ilADNNotification::getTypeDuringEvent ( )

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

References $type_during_event.

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

512  : int
513  {
514  return (int) $this->type_during_event;
515  }
+ Here is the caller graph for this function:

◆ hasDisplayEnded()

ilADNNotification::hasDisplayEnded ( )
protected

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

References getDisplayEnd(), and getTime().

Referenced by getActiveType(), and isVisible().

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

◆ hasDisplayStarted()

ilADNNotification::hasDisplayStarted ( )
protected

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

References getDisplayStart(), and getTime().

Referenced by getActiveType(), and isVisible().

532  : bool
533  {
534  return $this->getTime() > $this->getDisplayStart();
535  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasEventEnded()

ilADNNotification::hasEventEnded ( )
protected

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

References getEventEnd(), and getTime().

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

537  : bool
538  {
539  return $this->getTime() > $this->getEventEnd();
540  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasEventStarted()

ilADNNotification::hasEventStarted ( )
protected

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

References getEventStart(), and getTime().

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

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

◆ hasUserDismissed()

ilADNNotification::hasUserDismissed ( ilObjUser  $ilObjUser)
protected
Parameters
ilObjUser$ilObjUser
Returns
bool

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

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

Referenced by isVisibleForUser().

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

References $active.

587  : bool
588  {
589  return $this->active;
590  }

◆ isDuringEvent()

ilADNNotification::isDuringEvent ( )

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

References hasEventEnded(), and hasEventStarted().

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

557  : bool
558  {
559  return $this->hasEventStarted() && !$this->hasEventEnded();
560  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLimitToRoles()

ilADNNotification::isLimitToRoles ( )

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

References $limit_to_roles.

Referenced by isVisibleRoleUserRoles().

607  : bool
608  {
609  return (bool) $this->limit_to_roles;
610  }
+ Here is the caller graph for this function:

◆ isPermanent()

ilADNNotification::isPermanent ( )

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

References $permanent.

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

552  : bool
553  {
554  return (bool) $this->permanent;
555  }
+ Here is the caller graph for this function:

◆ isUserAllowedToDismiss()

ilADNNotification::isUserAllowedToDismiss ( ilObjUser  $ilUser)
Parameters
ilObjUser$ilUser
Returns
bool

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

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

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

100  {
101  return ($this->getDismissable() and $ilUser->getId() != 0 and $ilUser->getId() != ANONYMOUS_USER_ID);
102  }
const ANONYMOUS_USER_ID
Definition: constants.php:25
getId()
get object id public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVisible()

ilADNNotification::isVisible ( )
protected
Returns
bool

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

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

Referenced by isVisibleForUser().

124  {
125  if ($this->isPermanent()) {
126  return true;
127  }
128  $hasEventStarted = $this->hasEventStarted();
129  $hasDisplayStarted = $this->hasDisplayStarted();
130  $hasEventEnded = !$this->hasEventEnded();
131  $hasDisplayEnded = !$this->hasDisplayEnded();
132 
133  return ($hasEventStarted or $hasDisplayStarted) and ($hasEventEnded or $hasDisplayEnded);
134  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isVisibleForUser()

ilADNNotification::isVisibleForUser ( ilObjUser  $ilObjUser)
Parameters
ilObjUser$ilObjUser
Returns
bool

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

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

141  {
142  if ($ilObjUser->getId() == 0 && $this->isInterruptive()) {
143  return false;
144  }
145  if (!$this->isVisible()) {
146 
147  return false;
148  }
149  if ($this->hasUserDismissed($ilObjUser)) {
150  return false;
151  }
152  if (!$this->isVisibleRoleUserRoles($ilObjUser)) {
153  return false;
154  }
155 
156  return true;
157  }
hasUserDismissed(ilObjUser $ilObjUser)
isVisibleRoleUserRoles(ilObjUser $ilObjUser)
getId()
get object id public
+ Here is the call graph for this function:

◆ isVisibleRoleUserRoles()

ilADNNotification::isVisibleRoleUserRoles ( ilObjUser  $ilObjUser)
protected
Parameters
ilObjUser$ilObjUser
Returns
bool

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

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

Referenced by isVisibleForUser().

164  {
165  if (!$this->isLimitToRoles()) {
166  return true;
167  }
168  global $DIC;
169 
170  if ($ilObjUser->getId() === 0 && in_array(0, $this->getLimitedToRoleIds())) {
171  return true;
172  }
173 
174  return $DIC->rbac()->review()->isAssignedToAtLeastOneGivenRole($ilObjUser->getId(),
175  $this->getLimitedToRoleIds());
176  }
getId()
get object id public
global $DIC
Definition: goto.php:24
+ 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().

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
Returns
string
Deprecated:

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

43  {
44  return self::TABLE_NAME;
45  }

◆ setActive()

ilADNNotification::setActive ( bool  $active)

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

References $active.

592  : void
593  {
594  $this->active = $active;
595  }

◆ setBody()

ilADNNotification::setBody ( string  $body)

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

References $body.

427  : void
428  {
429  $this->body = $body;
430  }

◆ setCreateDate()

ilADNNotification::setCreateDate ( DateTimeImmutable  $create_date)

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

References $create_date.

Referenced by create().

562  : void
563  {
564  $this->create_date = $create_date;
565  }
+ Here is the caller graph for this function:

◆ setCreatedBy()

ilADNNotification::setCreatedBy ( int  $created_by)

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

References $created_by.

Referenced by create().

572  : void
573  {
574  $this->created_by = $created_by;
575  }
+ Here is the caller graph for this function:

◆ setDismissable()

ilADNNotification::setDismissable ( bool  $dismissable)

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

References $dismissable.

517  : void
518  {
519  $this->dismissable = $dismissable;
520  }

◆ setDisplayEnd()

ilADNNotification::setDisplayEnd ( DateTimeImmutable  $display_end)

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

References $display_end.

437  : void
438  {
439  $this->display_end = $display_end;
440  }

◆ setDisplayStart()

ilADNNotification::setDisplayStart ( DateTimeImmutable  $display_start)

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

References $display_start.

447  : void
448  {
449  $this->display_start = $display_start;
450  }

◆ setEventEnd()

ilADNNotification::setEventEnd ( DateTimeImmutable  $event_end)

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

References $event_end.

457  : void
458  {
459  $this->event_end = $event_end;
460  }

◆ setEventStart()

ilADNNotification::setEventStart ( DateTimeImmutable  $event_start)

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

References $event_start.

467  : void
468  {
469  $this->event_start = $event_start;
470  }

◆ setId()

ilADNNotification::setId ( int  $id)

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

References $id.

477  : void
478  {
479  $this->id = $id;
480  }

◆ setLimitedToRoleIds()

ilADNNotification::setLimitedToRoleIds ( array  $limited_to_role_ids)

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

References $limited_to_role_ids.

602  : void
603  {
604  $this->limited_to_role_ids = $limited_to_role_ids;
605  }

◆ setLimitToRoles()

ilADNNotification::setLimitToRoles ( bool  $limit_to_roles)

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

References $limit_to_roles.

612  : void
613  {
614  $this->limit_to_roles = $limit_to_roles;
615  }

◆ setPermanent()

ilADNNotification::setPermanent ( bool  $permanent)

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

References $permanent.

547  : void
548  {
549  $this->permanent = $permanent;
550  }

◆ setTitle()

ilADNNotification::setTitle ( string  $title)

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

References $title.

487  : void
488  {
489  $this->title = $title;
490  }

◆ setType()

ilADNNotification::setType ( int  $type)

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

References $type.

497  : void
498  {
499  $this->type = $type;
500  }

◆ setTypeDuringEvent()

ilADNNotification::setTypeDuringEvent ( int  $type_during_event)

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

References $type_during_event.

507  : void
508  {
509  $this->type_during_event = $type_during_event;
510  }

◆ wakeUp()

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

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

References $allowed_users, and ActiveRecord\sleep().

355  {
356  switch ($field_name) {
357  case 'event_start':
358  case 'event_end':
359  case 'display_end':
360  case 'display_start':
361  case 'create_date':
362  case 'last_update':
363  return (new DateTimeImmutable())->setTimestamp((int) $field_value);
364 
365  case 'allowed_users':
366  if ($field_value === null) {
367  $array_unique = self::$allowed_user_ids;
368  } else {
369  $json_decode = json_decode($field_value, true);
370  if (!is_array($json_decode)) {
371  $json_decode = self::$allowed_user_ids;
372  }
373  $array_unique = array_unique($json_decode);
374  }
375 
376  sort($array_unique);
377 
378  return $array_unique;
379  break;
380  case 'limited_to_role_ids':
381  return json_decode($field_value, true);
382  break;
383  }
384  }
+ Here is the call graph for this function:

Field Documentation

◆ $active

ilADNNotification::$active = true
protected

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

Referenced by isActive(), and setActive().

◆ $allowed_user_ids

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

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

◆ $allowed_users

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

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

Referenced by wakeUp().

◆ $body

ilADNNotification::$body = ''
protected

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

Referenced by getBody(), and setBody().

◆ $create_date

ilADNNotification::$create_date
protected

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

Referenced by setCreateDate().

◆ $created_by

ilADNNotification::$created_by = null
protected

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

Referenced by getCreatedBy(), and setCreatedBy().

◆ $dismissable

ilADNNotification::$dismissable = true
protected

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

Referenced by getDismissable(), and setDismissable().

◆ $display_end

ilADNNotification::$display_end
protected

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

Referenced by setDisplayEnd().

◆ $display_start

ilADNNotification::$display_start
protected

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

Referenced by setDisplayStart().

◆ $event_end

ilADNNotification::$event_end
protected

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

Referenced by setEventEnd().

◆ $event_start

ilADNNotification::$event_start
protected

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

Referenced by setEventStart().

◆ $id

ilADNNotification::$id
protected

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

Referenced by getId(), and setId().

◆ $interruptive

ilADNNotification::$interruptive = false
protected

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

◆ $last_update

ilADNNotification::$last_update
protected

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

◆ $last_update_by

ilADNNotification::$last_update_by = null
protected

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

◆ $limit_to_roles

ilADNNotification::$limit_to_roles = false
protected

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

Referenced by isLimitToRoles(), and setLimitToRoles().

◆ $limited_to_role_ids

ilADNNotification::$limited_to_role_ids = []
protected

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

Referenced by getLimitedToRoleIds(), and setLimitedToRoleIds().

◆ $link

ilADNNotification::$link = ''
protected

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

◆ $link_target

ilADNNotification::$link_target = '_top'
protected

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

◆ $link_type

ilADNNotification::$link_type = self::LINK_TYPE_NONE
protected

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

◆ $parent_id

ilADNNotification::$parent_id = null
protected

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

◆ $permanent

ilADNNotification::$permanent = true
protected

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

Referenced by isPermanent(), and setPermanent().

◆ $title

ilADNNotification::$title = ''
protected

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

Referenced by getTitle(), and setTitle().

◆ $type

ilADNNotification::$type = self::TYPE_INFO
protected

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

Referenced by getType(), and setType().

◆ $type_during_event

ilADNNotification::$type_during_event = self::TYPE_ERROR
protected

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

Referenced by getTypeDuringEvent(), and setTypeDuringEvent().

◆ DATE_FORMAT

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

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

◆ DATE_TIME_FORMAT

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

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

◆ LINK_TYPE_NONE

const ilADNNotification::LINK_TYPE_NONE = 0

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

◆ LINK_TYPE_REF_ID

const ilADNNotification::LINK_TYPE_REF_ID = 1

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

◆ LINK_TYPE_URL

const ilADNNotification::LINK_TYPE_URL = 2

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

◆ POS_BOTTOM

const ilADNNotification::POS_BOTTOM = 4

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

◆ POS_RIGHT

const ilADNNotification::POS_RIGHT = 2

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

◆ POS_TOP

const ilADNNotification::POS_TOP = 1

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

◆ POST_LEFT

const ilADNNotification::POST_LEFT = 3

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

◆ TABLE_NAME

const ilADNNotification::TABLE_NAME = 'il_adn_notifications'

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

◆ TIME_FORMAT

const ilADNNotification::TIME_FORMAT = 'H:i'

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

◆ TYPE_ERROR

◆ TYPE_INFO

◆ TYPE_WARNING


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