ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\components\Dashboard\Block\BlockDTO Class Reference
+ Collaboration diagram for ILIAS\components\Dashboard\Block\BlockDTO:

Public Member Functions

 __construct (private string $type, private int $ref_id, private int $obj_id, private string $title, private string $description, private ?ilDateTime $startDate=null, private ?ilDateTime $endDate=null, private array $additional_data=[])
 
 getType ()
 
 setType (string $type)
 
 getRefId ()
 
 setRefId (int $ref_id)
 
 getObjId ()
 
 setObjId (int $obj_id)
 
 getTitle ()
 
 setTitle (string $title)
 
 getDescription ()
 
 setDescription (string $description)
 
 getStartDate ()
 
 setStartDate (?ilDateTime $startDate)
 
 getEndDate ()
 
 setEndDate (?ilDateTime $endDate)
 
 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 int  $ref_id,
private int  $obj_id,
private string  $title,
private string  $description,
private ?ilDateTime  $startDate = null,
private ?ilDateTime  $endDate = null,
private array  $additional_data = [] 
)

Definition at line 27 of file BlockDTO.php.

36 {
37 $this->type = $type;
38 $this->ref_id = $ref_id;
39 $this->obj_id = $obj_id;
40 $this->title = $title;
41 $this->description = $description;
42 $this->startDate = $startDate;
43 $this->endDate = $endDate;
44 $this->additional_data = $additional_data;
45 }
$ref_id
Definition: ltiauth.php:66

References $ref_id.

Member Function Documentation

◆ getAdditionalData()

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

Definition at line 137 of file BlockDTO.php.

137 : array
138 {
139 return $this->additional_data;
140 }

◆ getDescription()

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

Definition at line 87 of file BlockDTO.php.

87 : string
88 {
89 return $this->description;
90 }

◆ getEndDate()

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

Definition at line 107 of file BlockDTO.php.

107 : ?ilDateTime
108 {
109 return $this->endDate;
110 }
@classDescription Date and time handling

◆ getObjId()

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

Definition at line 67 of file BlockDTO.php.

67 : int
68 {
69 return $this->obj_id;
70 }

◆ getRefId()

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

Definition at line 57 of file BlockDTO.php.

57 : int
58 {
59 return $this->ref_id;
60 }

References $ref_id.

Referenced by ilDashboardBlockGUI\sortManually().

+ Here is the caller graph for this function:

◆ getStartDate()

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

Definition at line 97 of file BlockDTO.php.

97 : ?ilDateTime
98 {
99 return $this->startDate;
100 }

Referenced by ilDashboardBlockGUI\sortByDate().

+ Here is the caller graph for this function:

◆ getTitle()

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

Definition at line 77 of file BlockDTO.php.

77 : string
78 {
79 return $this->title;
80 }

Referenced by ilDashboardBlockGUI\sortByTitle().

+ Here is the caller graph for this function:

◆ getType()

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

Definition at line 47 of file BlockDTO.php.

47 : string
48 {
49 return $this->type;
50 }

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

+ Here is the caller graph for this function:

◆ hasEnded()

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

Definition at line 122 of file BlockDTO.php.

122 : bool
123 {
124 return $this->endDate && $this->endDate->get(IL_CAL_UNIX) < time();
125 }
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 ( )

Definition at line 117 of file BlockDTO.php.

117 : bool
118 {
119 return $this->startDate && $this->startDate->get(IL_CAL_UNIX) > time();
120 }

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 ( )

Definition at line 132 of file BlockDTO.php.

132 : bool
133 {
134 return $this->startDate || $this->endDate;
135 }

◆ isRunning()

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

Definition at line 127 of file BlockDTO.php.

127 : bool
128 {
129 return !$this->hasNotStarted() && !$this->hasEnded();
130 }

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)

Definition at line 142 of file BlockDTO.php.

142 : void
143 {
144 $this->additional_data = $additional_data;
145 }

◆ setDescription()

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

Definition at line 92 of file BlockDTO.php.

92 : void
93 {
94 $this->description = $description;
95 }

◆ setEndDate()

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

Definition at line 112 of file BlockDTO.php.

112 : void
113 {
114 $this->endDate = $endDate;
115 }

◆ setObjId()

ILIAS\components\Dashboard\Block\BlockDTO::setObjId ( int  $obj_id)

Definition at line 72 of file BlockDTO.php.

72 : void
73 {
74 $this->obj_id = $obj_id;
75 }

◆ setRefId()

ILIAS\components\Dashboard\Block\BlockDTO::setRefId ( int  $ref_id)

Definition at line 62 of file BlockDTO.php.

62 : void
63 {
64 $this->ref_id = $ref_id;
65 }

References $ref_id.

◆ setStartDate()

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

Definition at line 102 of file BlockDTO.php.

102 : void
103 {
104 $this->startDate = $startDate;
105 }

◆ setTitle()

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

Definition at line 82 of file BlockDTO.php.

82 : void
83 {
84 $this->title = $title;
85 }

◆ setType()

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

Definition at line 52 of file BlockDTO.php.

52 : void
53 {
54 $this->type = $type;
55 }

◆ toArray()

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

Definition at line 147 of file BlockDTO.php.

147 : array
148 {
149 return [
150 'type' => $this->type,
151 'ref_id' => $this->ref_id,
152 'obj_id' => $this->obj_id,
153 'title' => $this->title,
154 'description' => $this->description,
155 'start_date' => $this->startDate?->get(IL_CAL_DATETIME),
156 'end_date' => $this->endDate?->get(IL_CAL_DATETIME),
157 'additional_data' => $this->additional_data
158 ];
159 }
const IL_CAL_DATETIME

References $ref_id, and IL_CAL_DATETIME.


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