85 return date(self::DATE_FORMAT, $this->
getEventEnd()) .
', ' . date(
91 return date(self::DATE_TIME_FORMAT, $this->
getEventStart()) .
' - ' . date(
92 self::DATE_TIME_FORMAT,
127 return ($hasEventStarted || $hasDisplayStarted)
128 && ($hasEventEnded || $hasDisplayEnded);
133 if ($ilObjUser->
getId() === 0 && $this->interruptive) {
155 $current_language =
$DIC->http()->request()->getQueryParams()[
'lang']
156 ??
$DIC->language()->getDefaultLanguage();
176 return $DIC->rbac()->review()->isAssignedToAtLeastOneGivenRole(
178 $this->getLimitedToRoleIds()
190 protected ?
int $id =
null;
346 public function wakeUp($field_name, $field_value)
348 switch ($field_name) {
352 case 'display_start':
355 return (
new DateTimeImmutable())->setTimestamp((
int) $field_value);
357 case 'allowed_users':
358 if ($field_value ===
null) {
361 $json_decode = json_decode((
string) $field_value,
true);
362 if (!is_array($json_decode)) {
365 $array_unique = array_unique($json_decode);
370 return $array_unique;
371 case 'limited_to_languages':
372 case 'limited_to_role_ids':
373 return json_decode((
string) $field_value,
true);
382 public function sleep($field_name)
384 switch ($field_name) {
388 case 'display_start':
394 $datetime = $this->{$field_name} ??
new DateTimeImmutable();
396 case 'allowed_users':
398 foreach ($this->allowed_users as
$user_id) {
402 return json_encode(array_unique(
$allowed_users), JSON_THROW_ON_ERROR);
403 case 'limited_to_languages':
404 case 'limited_to_role_ids':
405 return json_encode($this->{$field_name}, JSON_THROW_ON_ERROR);
436 return $this->display_end ??
new DateTimeImmutable();
446 return $this->display_start ??
new DateTimeImmutable();
456 return $this->event_end ??
new DateTimeImmutable();
466 return $this->event_start ??
new DateTimeImmutable();
507 $this->type_during_event,
508 [self::TYPE_WARNING, self::TYPE_ERROR, self::TYPE_INFO]
564 return $this->create_date ??
new DateTimeImmutable();
577 protected function getTime(): DateTimeImmutable
579 return new DateTimeImmutable();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static where($where, $operator=null)
static dismiss(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
static hasDimissed(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
int $link_type
@con_has_field true @con_fieldtype integer @con_length 1
static returnDbTableName()
setHasLanguageLimitation(bool $has_language_limitation)
string $link_target
@con_has_field true @con_fieldtype text @con_length 256
setCreateDate(DateTimeImmutable $create_date)
array $limited_to_languages
@con_has_field true @con_fieldtype text @con_length 256
int $type_during_event
@con_has_field true @con_fieldtype integer @con_length 1
setEventEnd(DateTimeImmutable $event_end)
bool $active
@con_has_field true @con_fieldtype integer @con_length 1
DateTimeImmutable $event_start
@con_has_field true @con_fieldtype integer @con_length 8
DateTimeImmutable $create_date
@con_has_field true @con_fieldtype integer @con_length 8
bool $interruptive
@con_has_field true @con_fieldtype integer @con_length 1
hasUserDismissed(ilObjUser $ilObjUser)
int $type
@con_has_field true @con_fieldtype integer @con_length 1
string $link
@con_has_field true @con_fieldtype text @con_length 256
DateTimeImmutable $display_end
@con_has_field true @con_fieldtype integer @con_length 8
setLimitedToLanguages(array $limited_to_languages)
static array $allowed_user_ids
array $limited_to_role_ids
@con_has_field true @con_fieldtype text @con_length 256
getConnectorContainerName()
@description Return the Name of your Connector Table
DateTimeImmutable $display_start
@con_has_field true @con_fieldtype integer @con_length 8
bool $limit_to_roles
@con_has_field true @con_fieldtype integer @con_length 1
bool $permanent
@con_has_field true @con_fieldtype integer @con_length 1
int $created_by
@con_has_field true @con_fieldtype integer @con_length 8
DateTimeImmutable $event_end
@con_has_field true @con_fieldtype integer @con_length 8
string $body
@con_has_field true @con_fieldtype clob
dismiss(ilObjUser $ilObjUser)
setPermanent(bool $permanent)
array $allowed_users
@con_has_field true @con_fieldtype text @con_length 256
DateTimeImmutable $last_update
@con_has_field true @con_fieldtype integer @con_length 8
isVisibleForUser(ilObjUser $ilObjUser)
string $title
@con_has_field true @con_fieldtype text @con_length 256
setDismissable(bool $dismissable)
setCreatedBy(int $created_by)
setLimitToRoles(bool $limit_to_roles)
setDisplayStart(DateTimeImmutable $display_start)
isVisibleToUserBasedOnLanguage(ilObjUser $user)
isVisibleRoleUserRoles(ilObjUser $ilObjUser)
int $id
@con_is_primary true @con_sequence true @con_is_unique true @con_has_field true @con_fieldtype intege...
setEventStart(DateTimeImmutable $event_start)
setDisplayEnd(DateTimeImmutable $display_end)
bool $dismissable
@con_has_field true @con_fieldtype integer @con_length 1
int $last_update_by
@con_has_field true @con_fieldtype integer @con_length 8
setTypeDuringEvent(int $type_during_event)
setLimitedToRoleIds(array $limited_to_role_ids)
int $parent_id
@con_has_field true @con_fieldtype integer @con_length 8
wakeUp($field_name, $field_value)
isUserAllowedToDismiss(ilObjUser $user)
bool $has_language_limitation
@con_has_field true @con_fieldtype integer @con_length 1