ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\Test\Settings\Templates\PersonalSettingsTemplate Class Reference
+ Inheritance diagram for ILIAS\Test\Settings\Templates\PersonalSettingsTemplate:
+ Collaboration diagram for ILIAS\Test\Settings\Templates\PersonalSettingsTemplate:

Public Member Functions

 __construct (private int $id, private int $user_id, private string $name, private string $description, private string $author, private \DateTimeImmutable $created_at, private int $settings_id=-1)
 
 getId ()
 
 withId (int $id)
 
 getUserId ()
 
 withUserId (int $user_id)
 
 getName ()
 
 getDescription ()
 
 getAuthor ()
 
 getCreatedAt ()
 
 getSettingsId ()
 
 toExport ()
 Transform the object into a simple, associative array. More...
 
 toExport ()
 Transform the object into a simple, associative array. More...
 

Static Public Member Functions

static fromExport (array $data)
 Creates an instance of the object from an array. More...
 
static fromExport (array $data)
 Creates an instance of the object from an array. More...
 

Detailed Description

Definition at line 25 of file PersonalSettingsTemplate.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::__construct ( private int  $id,
private int  $user_id,
private string  $name,
private string  $description,
private string  $author,
private \DateTimeImmutable  $created_at,
private int  $settings_id = -1 
)

Definition at line 27 of file PersonalSettingsTemplate.php.

35 {
36 }

Member Function Documentation

◆ fromExport()

static ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::fromExport ( array  $data)
static

Creates an instance of the object from an array.

This static factory method is responsible for constructing a new object instance from the provided array data. It should validate the input and may throw an exception if the data is incomplete or malformed.

Parameters
ExportableArray$dataThe data to restore the object from
Returns
static A new instance of the class

Implements ILIAS\Test\ExportImport\Exportable.

Definition at line 99 of file PersonalSettingsTemplate.php.

99 : static
100 {
101 return new self(
102 (int) $data['id'],
103 (int) $data['user_id'],
104 (string) $data['name'],
105 (string) $data['description'],
106 (string) $data['author'],
107 new \DateTimeImmutable($data['created_at'])
108 );
109 }

References $data, and ILIAS\Repository\int().

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsImportAction\importFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAuthor()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::getAuthor ( )

Definition at line 72 of file PersonalSettingsTemplate.php.

72 : string
73 {
74 return $this->author;
75 }

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\toExport().

+ Here is the caller graph for this function:

◆ getCreatedAt()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::getCreatedAt ( )

Definition at line 77 of file PersonalSettingsTemplate.php.

77 : \DateTimeImmutable
78 {
79 return $this->created_at;
80 }

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\toExport().

+ Here is the caller graph for this function:

◆ getDescription()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::getDescription ( )

Definition at line 67 of file PersonalSettingsTemplate.php.

67 : string
68 {
69 return $this->description;
70 }

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\toExport().

+ Here is the caller graph for this function:

◆ getId()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::getId ( )

Definition at line 38 of file PersonalSettingsTemplate.php.

38 : int
39 {
40 return $this->id;
41 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsTableDeleteAction\deleteTemplate(), ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\toExport(), and ILIAS\Test\Settings\Templates\PersonalSettingsExporter\write().

+ Here is the caller graph for this function:

◆ getName()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::getName ( )

Definition at line 62 of file PersonalSettingsTemplate.php.

62 : string
63 {
64 return $this->name;
65 }

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\toExport().

+ Here is the caller graph for this function:

◆ getSettingsId()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::getSettingsId ( )

Definition at line 82 of file PersonalSettingsTemplate.php.

82 : int
83 {
84 return $this->settings_id;
85 }

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsExporter\write().

+ Here is the caller graph for this function:

◆ getUserId()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::getUserId ( )

Definition at line 50 of file PersonalSettingsTemplate.php.

50 : int
51 {
52 return $this->user_id;
53 }

References $user_id.

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\toExport().

+ Here is the caller graph for this function:

◆ toExport()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::toExport ( )

Transform the object into a simple, associative array.

The resulting array represents the object's state and should contain only scalar values, arrays, or other Exportable objects.

Returns
ExportableArray The exportable array representation of the object

Implements ILIAS\Test\ExportImport\Exportable.

Definition at line 87 of file PersonalSettingsTemplate.php.

References ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\getAuthor(), ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\getCreatedAt(), ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\getDescription(), ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\getId(), ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\getName(), and ILIAS\Test\Settings\Templates\PersonalSettingsTemplate\getUserId().

Referenced by ILIAS\Test\Settings\Templates\PersonalSettingsExporter\write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withId()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::withId ( int  $id)

Definition at line 43 of file PersonalSettingsTemplate.php.

43 : self
44 {
45 $clone = clone $this;
46 $clone->id = $id;
47 return $clone;
48 }

References $id.

◆ withUserId()

ILIAS\Test\Settings\Templates\PersonalSettingsTemplate::withUserId ( int  $user_id)

Definition at line 55 of file PersonalSettingsTemplate.php.

55 : self
56 {
57 $clone = clone $this;
58 $clone->user_id = $user_id;
59 return $clone;
60 }

References $user_id.


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