ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository Class Reference
+ Collaboration diagram for ILIAS\MetaData\OERHarvester\Settings\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\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository::__construct ( protected ilDBInterface  $db,
protected InternalDataService  $data 
)

Definition at line 28 of file SettingsDBRepository.php.

31  {
32  }

Member Function Documentation

◆ create()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository::create ( Settings  $settings)

Definition at line 34 of file SettingsDBRepository.php.

References ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getId().

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

◆ delete()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository::delete ( int  $id)

Definition at line 65 of file SettingsDBRepository.php.

References $id.

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

◆ getById()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository::getById ( int  $id)

Definition at line 51 of file SettingsDBRepository.php.

References ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository\getSettingsFromRecord(), and null.

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getSettingsFromRecord()

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

Definition at line 74 of file SettingsDBRepository.php.

Referenced by ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository\getById().

74  : Settings
75  {
76  return $this->data->settings(
77  (int) $rec['id'],
78  (bool) $rec['ppic']
79  );
80  }
+ Here is the caller graph for this function:

◆ update()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsDBRepository::update ( Settings  $settings)

Definition at line 42 of file SettingsDBRepository.php.

References ILIAS\MetaData\OERHarvester\Settings\Settings\Settings\getId().

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

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