43 return self::TABLE_NAME;
51 return self::TABLE_NAME;
83 return date(self::DATE_FORMAT, $this->
getEventEnd()) .
', ' . date(
89 return date(self::DATE_TIME_FORMAT, $this->
getEventStart()) .
' - ' . date(
90 self::DATE_TIME_FORMAT,
112 return self::TYPE_INFO;
126 return ($hasEventStarted || $hasDisplayStarted)
127 && ($hasEventEnded || $hasDisplayEnded);
156 return $DIC->rbac()->review()->isAssignedToAtLeastOneGivenRole(
170 protected ?
int $id = null;
211 protected int $type = self::TYPE_INFO;
314 public function wakeUp($field_name, $field_value)
316 switch ($field_name) {
320 case 'display_start':
325 case 'allowed_users':
326 if ($field_value === null) {
327 $array_unique = self::$allowed_user_ids;
329 $json_decode = json_decode($field_value,
true);
330 if (!is_array($json_decode)) {
331 $json_decode = self::$allowed_user_ids;
333 $array_unique = array_unique($json_decode);
338 return $array_unique;
339 case 'limited_to_role_ids':
340 return json_decode($field_value,
true);
348 public function sleep($field_name)
350 switch ($field_name) {
354 case 'display_start':
361 return $datetime->getTimestamp();
362 case 'allowed_users':
363 $allowed_users = self::$allowed_user_ids;
364 foreach ($this->allowed_users as $user_id) {
365 $allowed_users[] = (
int) $user_id;
368 return json_encode(array_unique($allowed_users), JSON_THROW_ON_ERROR);
369 case 'limited_to_role_ids':
370 return json_encode($this->{$field_name}, JSON_THROW_ON_ERROR);
432 public function setId(
int $id): void
470 $this->type_during_event,
471 [self::TYPE_WARNING, self::TYPE_ERROR, self::TYPE_INFO]
472 ) ? $this->type_during_event : self::TYPE_INFO;
DateTimeImmutable $display_end
true integer 8
bool $dismissable
true integer 1
static hasDimissed(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
array $limited_to_role_ids
true text 256
wakeUp($field_name, $field_value)
static dismiss(ilObjUser $ilObjUser, ilADNNotification $ilADNNotification)
setEventEnd(DateTimeImmutable $event_end)
dismiss(ilObjUser $ilObjUser)
bool $permanent
true integer 1
int $type_during_event
true integer 1
int $id
true true true true integer 8
static array $allowed_user_ids
DateTimeImmutable $last_update
true integer 8
string $title
true text 256
hasUserDismissed(ilObjUser $ilObjUser)
static where($where, $operator=null)
setCreateDate(DateTimeImmutable $create_date)
isUserAllowedToDismiss(ilObjUser $user)
bool $interruptive
true integer 1
setDisplayEnd(DateTimeImmutable $display_end)
int $parent_id
true integer 8
DateTimeImmutable $event_start
true integer 8
static returnDbTableName()
DateTimeImmutable $create_date
true integer 8
isVisibleRoleUserRoles(ilObjUser $ilObjUser)
DateTimeImmutable $display_start
true integer 8
setLimitedToRoleIds(array $limited_to_role_ids)
setPermanent(bool $permanent)
bool $active
true integer 1
array $allowed_users
true text 256
string $link_target
true text 256
int $link_type
true integer 1
string $link
true text 256
isVisibleForUser(ilObjUser $ilObjUser)
int $created_by
true integer 8
getConnectorContainerName()
setLimitToRoles(bool $limit_to_roles)
bool $limit_to_roles
true integer 1
DateTimeImmutable $event_end
true integer 8
setCreatedBy(int $created_by)
setTypeDuringEvent(int $type_during_event)
setDisplayStart(DateTimeImmutable $display_start)
setEventStart(DateTimeImmutable $event_start)
int $last_update_by
true integer 8
setDismissable(bool $dismissable)