ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ILIAS\components\Dashboard\Block\BlockDTO Class Reference
+ Collaboration diagram for ILIAS\components\Dashboard\Block\BlockDTO:

Public Member Functions

 __construct (private string $type, private readonly int $ref_id, private readonly int $obj_id, private string $title, private string $description, private ?ilDateTime $start_date=null, private ?ilDateTime $end_date=null, private array $additional_data=[])
 
 getType ()
 
 setType (string $type)
 
 getRefId ()
 
 getObjId ()
 
 getTitle ()
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getStartDate ()
 
 setStartDate (?ilDateTime $start_date)
 
 getEndDate ()
 
 setEndDate (?ilDateTime $end_date)
 
 hasNotStarted ()
 
 hasEnded ()
 
 isRunning ()
 
 isDated ()
 
 getAdditionalData ()
 
 setAdditionalData (array $additional_data)
 
 toArray ()
 

Detailed Description

Definition at line 25 of file BlockDTO.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\components\Dashboard\Block\BlockDTO::__construct ( private string  $type,
private readonly int  $ref_id,
private readonly int  $obj_id,
private string  $title,
private string  $description,
private ?ilDateTime  $start_date = null,
private ?ilDateTime  $end_date = null,
private array  $additional_data = [] 
)

Definition at line 27 of file BlockDTO.php.

36 {
37 }

Member Function Documentation

◆ getAdditionalData()

ILIAS\components\Dashboard\Block\BlockDTO::getAdditionalData ( )
final

Definition at line 119 of file BlockDTO.php.

119 : array
120 {
121 return $this->additional_data;
122 }

◆ getDescription()

ILIAS\components\Dashboard\Block\BlockDTO::getDescription ( )
final

Definition at line 69 of file BlockDTO.php.

69 : string
70 {
71 return $this->description;
72 }

◆ getEndDate()

ILIAS\components\Dashboard\Block\BlockDTO::getEndDate ( )
final

Definition at line 89 of file BlockDTO.php.

89 : ?ilDateTime
90 {
91 return $this->end_date;
92 }
@classDescription Date and time handling

◆ getObjId()

ILIAS\components\Dashboard\Block\BlockDTO::getObjId ( )
final

Definition at line 54 of file BlockDTO.php.

54 : int
55 {
56 return $this->obj_id;
57 }

◆ getRefId()

ILIAS\components\Dashboard\Block\BlockDTO::getRefId ( )
final

Definition at line 49 of file BlockDTO.php.

49 : int
50 {
51 return $this->ref_id;
52 }
$ref_id
Definition: ltiauth.php:66

References $ref_id.

Referenced by ilDashboardBlockGUI\sortManually().

+ Here is the caller graph for this function:

◆ getStartDate()

ILIAS\components\Dashboard\Block\BlockDTO::getStartDate ( )
final

Definition at line 79 of file BlockDTO.php.

79 : ?ilDateTime
80 {
81 return $this->start_date;
82 }

Referenced by ilDashboardBlockGUI\sortByDate().

+ Here is the caller graph for this function:

◆ getTitle()

ILIAS\components\Dashboard\Block\BlockDTO::getTitle ( )
final

Definition at line 59 of file BlockDTO.php.

59 : string
60 {
61 return $this->title;
62 }

Referenced by ilDashboardBlockGUI\sortByTitle().

+ Here is the caller graph for this function:

◆ getType()

ILIAS\components\Dashboard\Block\BlockDTO::getType ( )
final

Definition at line 39 of file BlockDTO.php.

39 : string
40 {
41 return $this->type;
42 }

Referenced by ilDashboardBlockGUI\getCardForData(), and ilDashboardBlockGUI\getListItemForDataDTO().

+ Here is the caller graph for this function:

◆ hasEnded()

ILIAS\components\Dashboard\Block\BlockDTO::hasEnded ( )
final

Definition at line 104 of file BlockDTO.php.

104 : bool
105 {
106 return $this->end_date && $this->end_date->get(IL_CAL_UNIX) < time();
107 }
const IL_CAL_UNIX

References IL_CAL_UNIX.

Referenced by ILIAS\components\Dashboard\Block\BlockDTO\isRunning().

+ Here is the caller graph for this function:

◆ hasNotStarted()

ILIAS\components\Dashboard\Block\BlockDTO::hasNotStarted ( )
final

Definition at line 99 of file BlockDTO.php.

99 : bool
100 {
101 return $this->start_date && $this->start_date->get(IL_CAL_UNIX) > time();
102 }

References IL_CAL_UNIX.

Referenced by ILIAS\components\Dashboard\Block\BlockDTO\isRunning().

+ Here is the caller graph for this function:

◆ isDated()

ILIAS\components\Dashboard\Block\BlockDTO::isDated ( )
final

Definition at line 114 of file BlockDTO.php.

114 : bool
115 {
116 return $this->start_date || $this->end_date;
117 }

◆ isRunning()

ILIAS\components\Dashboard\Block\BlockDTO::isRunning ( )
final

Definition at line 109 of file BlockDTO.php.

109 : bool
110 {
111 return !$this->hasNotStarted() && !$this->hasEnded();
112 }

References ILIAS\components\Dashboard\Block\BlockDTO\hasEnded(), and ILIAS\components\Dashboard\Block\BlockDTO\hasNotStarted().

+ Here is the call graph for this function:

◆ setAdditionalData()

ILIAS\components\Dashboard\Block\BlockDTO::setAdditionalData ( array  $additional_data)
final

Definition at line 124 of file BlockDTO.php.

124 : void
125 {
126 $this->additional_data = $additional_data;
127 }

◆ setDescription()

ILIAS\components\Dashboard\Block\BlockDTO::setDescription ( string  $description)
final

Definition at line 74 of file BlockDTO.php.

74 : void
75 {
76 $this->description = $description;
77 }

◆ setEndDate()

ILIAS\components\Dashboard\Block\BlockDTO::setEndDate ( ?ilDateTime  $end_date)
final

Definition at line 94 of file BlockDTO.php.

94 : void
95 {
96 $this->end_date = $end_date;
97 }

◆ setStartDate()

ILIAS\components\Dashboard\Block\BlockDTO::setStartDate ( ?ilDateTime  $start_date)
final

Definition at line 84 of file BlockDTO.php.

84 : void
85 {
86 $this->start_date = $start_date;
87 }

◆ setTitle()

ILIAS\components\Dashboard\Block\BlockDTO::setTitle ( string  $title)
final

Definition at line 64 of file BlockDTO.php.

64 : void
65 {
66 $this->title = $title;
67 }

◆ setType()

ILIAS\components\Dashboard\Block\BlockDTO::setType ( string  $type)
final

Definition at line 44 of file BlockDTO.php.

44 : void
45 {
46 $this->type = $type;
47 }

◆ toArray()

ILIAS\components\Dashboard\Block\BlockDTO::toArray ( )
final

Definition at line 129 of file BlockDTO.php.

129 : array
130 {
131 return [
132 'type' => $this->type,
133 'ref_id' => $this->ref_id,
134 'obj_id' => $this->obj_id,
135 'title' => $this->title,
136 'description' => $this->description,
137 'start_date' => $this->start_date?->get(IL_CAL_DATETIME),
138 'end_date' => $this->end_date?->get(IL_CAL_DATETIME),
139 'additional_data' => $this->additional_data
140 ];
141 }
const IL_CAL_DATETIME

References $ref_id, and IL_CAL_DATETIME.


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