ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Portfolio\Settings\SettingsDBRepository Class Reference
+ Collaboration diagram for ILIAS\Portfolio\Settings\SettingsDBRepository:

Public Member Functions

 __construct (protected ilDBInterface $db, protected InternalDataService $data)
 
 create (Settings $settings)
 
 update (Settings $settings)
 
 getById (int $id)
 
 delete (int $id)
 

Protected Member Functions

 getSettingsFromRecord (array $rec)
 

Detailed Description

Definition at line 26 of file SettingsDBRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Portfolio\Settings\SettingsDBRepository::__construct ( protected ilDBInterface  $db,
protected InternalDataService  $data 
)

Definition at line 28 of file SettingsDBRepository.php.

31 {
32 }

Member Function Documentation

◆ create()

ILIAS\Portfolio\Settings\SettingsDBRepository::create ( Settings  $settings)

Definition at line 34 of file SettingsDBRepository.php.

34 : void
35 {
36 $this->db->insert('usr_portfolio', [
37 'id' => ['integer', $settings->getId()],
38 'ppic' => ['integer', $settings->getShowPersonalPicture()]
39 ]);
40 }

References ILIAS\Portfolio\Settings\Settings\getId(), and ILIAS\Portfolio\Settings\Settings\getShowPersonalPicture().

+ Here is the call graph for this function:

◆ delete()

ILIAS\Portfolio\Settings\SettingsDBRepository::delete ( int  $id)

Definition at line 65 of file SettingsDBRepository.php.

65 : void
66 {
67 $this->db->manipulateF(
68 'DELETE FROM usr_portfolio WHERE id = %s',
69 ['integer'],
70 [$id]
71 );
72 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

◆ getById()

ILIAS\Portfolio\Settings\SettingsDBRepository::getById ( int  $id)

Definition at line 51 of file SettingsDBRepository.php.

51 : ?Settings
52 {
53 $set = $this->db->queryF(
54 'SELECT * FROM usr_portfolio WHERE id = %s',
55 ['integer'],
56 [$id]
57 );
58 $rec = $this->db->fetchAssoc($set);
59 if ($rec) {
60 return $this->getSettingsFromRecord($rec);
61 }
62 return null;
63 }

References $id, and ILIAS\Portfolio\Settings\SettingsDBRepository\getSettingsFromRecord().

+ Here is the call graph for this function:

◆ getSettingsFromRecord()

ILIAS\Portfolio\Settings\SettingsDBRepository::getSettingsFromRecord ( array  $rec)
protected

Definition at line 74 of file SettingsDBRepository.php.

74 : Settings
75 {
76 return $this->data->settings(
77 (int) $rec['id'],
78 (bool) $rec['ppic']
79 );
80 }

Referenced by ILIAS\Portfolio\Settings\SettingsDBRepository\getById().

+ Here is the caller graph for this function:

◆ update()

ILIAS\Portfolio\Settings\SettingsDBRepository::update ( Settings  $settings)

Definition at line 42 of file SettingsDBRepository.php.

42 : void
43 {
44 $this->db->update('usr_portfolio', [
45 'ppic' => ['integer', $settings->getShowPersonalPicture()]
46 ], [
47 'id' => ['integer', $settings->getId()],
48 ]);
49 }

References ILIAS\Portfolio\Settings\Settings\getId(), and ILIAS\Portfolio\Settings\Settings\getShowPersonalPicture().

+ Here is the call graph for this function:

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