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) {
152 return in_array($ilObjUser->
getLanguage(), $this->getLimitedToLanguages(),
true);
167 return $DIC->rbac()->review()->isAssignedToAtLeastOneGivenRole(
169 $this->getLimitedToRoleIds()
181 protected ?
int $id =
null;
337 public function wakeUp($field_name, $field_value)
339 switch ($field_name) {
343 case 'display_start':
346 return (
new DateTimeImmutable())->setTimestamp((
int) $field_value);
348 case 'allowed_users':
349 if ($field_value ===
null) {
352 $json_decode = json_decode((
string) $field_value,
true);
353 if (!is_array($json_decode)) {
356 $array_unique = array_unique($json_decode);
361 return $array_unique;
362 case 'limited_to_languages':
363 case 'limited_to_role_ids':
364 return json_decode((
string) $field_value,
true);
373 public function sleep($field_name)
375 switch ($field_name) {
379 case 'display_start':
385 $datetime = $this->{$field_name} ??
new DateTimeImmutable();
387 case 'allowed_users':
389 foreach ($this->allowed_users as
$user_id) {
393 return json_encode(array_unique(
$allowed_users), JSON_THROW_ON_ERROR);
394 case 'limited_to_languages':
395 case 'limited_to_role_ids':
396 return json_encode($this->{$field_name}, JSON_THROW_ON_ERROR);
427 return $this->display_end ??
new DateTimeImmutable();
437 return $this->display_start ??
new DateTimeImmutable();
447 return $this->event_end ??
new DateTimeImmutable();
457 return $this->event_start ??
new DateTimeImmutable();
498 $this->type_during_event,
499 [self::TYPE_WARNING, self::TYPE_ERROR, self::TYPE_INFO]
555 return $this->create_date ??
new DateTimeImmutable();
568 protected function getTime(): DateTimeImmutable
570 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)
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)
isVisibleToUserBasedOnLanguage(ilObjUser $ilObjUser)
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