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

Definition at line 28 of file SettingsDBRepository.php.

31 {
32 }

Member Function Documentation

◆ create()

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

Definition at line 34 of file SettingsDBRepository.php.

34 : void
35 {
36 $this->db->insert('mep_data', [
37 'id' => ['integer', $settings->getId()],
38 'default_width' => ['integer', $settings->getDefaultWidth()],
39 'default_height' => ['integer', $settings->getDefaultHeight()],
40 'for_translation' => ['integer', (int) $settings->getForTranslation()],
41 ]);
42 }

References ILIAS\MediaPool\Settings\Settings\getDefaultHeight(), ILIAS\MediaPool\Settings\Settings\getDefaultWidth(), ILIAS\MediaPool\Settings\Settings\getForTranslation(), and ILIAS\MediaPool\Settings\Settings\getId().

+ Here is the call graph for this function:

◆ delete()

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

Definition at line 71 of file SettingsDBRepository.php.

71 : void
72 {
73 $this->db->manipulateF(
74 'DELETE FROM mep_data WHERE id = %s',
75 ['integer'],
76 [$id]
77 );
78 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id.

◆ getById()

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

Definition at line 55 of file SettingsDBRepository.php.

55 : ?Settings
56 {
57 $set = $this->db->queryF(
58 'SELECT * FROM mep_data WHERE id = %s',
59 ['integer'],
60 [$id]
61 );
62
63 $rec = $this->db->fetchAssoc($set);
64 if ($rec) {
65 return $this->getSettingsFromRecord($rec);
66 }
67
68 return null;
69 }

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

+ Here is the call graph for this function:

◆ getSettingsFromRecord()

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

Definition at line 80 of file SettingsDBRepository.php.

80 : Settings
81 {
82 return $this->data->settings(
83 (int) $rec['id'],
84 (int) $rec['default_width'],
85 (int) $rec['default_height'],
86 (bool) $rec['for_translation']
87 );
88 }

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

+ Here is the caller graph for this function:

◆ update()

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

Definition at line 44 of file SettingsDBRepository.php.

44 : void
45 {
46 $this->db->update('mep_data', [
47 'default_width' => ['integer', $settings->getDefaultWidth()],
48 'default_height' => ['integer', $settings->getDefaultHeight()],
49 'for_translation' => ['integer', (int) $settings->getForTranslation()],
50 ], [
51 'id' => ['integer', $settings->getId()],
52 ]);
53 }

References ILIAS\MediaPool\Settings\Settings\getDefaultHeight(), ILIAS\MediaPool\Settings\Settings\getDefaultWidth(), ILIAS\MediaPool\Settings\Settings\getForTranslation(), and ILIAS\MediaPool\Settings\Settings\getId().

+ Here is the call graph for this function:

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