/var/www/html_de/wp-content/plugins/wp-smtp/src/Mail/Repository/SettingsRepository.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php

namespace SolidWP\Mail\Repository;

use 
SolidWP\Mail\Admin\SettingsScreen;

/**
 * Class SettingsRepository
 *
 * This class handles settings-related operations for the Solid Mail plugin.
 * It provides methods to retrieve and check plugin settings.
 *
 * @package SolidWP\Mail\Repository
 */
class SettingsRepository {

    
/**
     * The SettingsScreen instance.
     *
     * @var SettingsScreen
     */
    
private SettingsScreen $settings_screen;

    
/**
     * Constructor.
     *
     * @param SettingsScreen $settings_screen The SettingsScreen instance.
     */
    
public function __constructSettingsScreen $settings_screen ) {
        
$this->settings_screen $settings_screen;
    }

    
/**
     * Checks if logs are disabled.
     *
     * @return bool True if logs are disabled, false otherwise.
     */
    
public function logs_disabled(): bool {
        
$settings $this->settings_screen->get_settings();

        return 
$settings['disable_logs'] === 'yes';
    }

    
/**
     * Checks if unmatched connections should be used as fallbacks.
     *
     * @return bool True if unmatched connections should be used, false otherwise.
     */
    
public function use_unmatched_connections(): bool {
        
$settings $this->settings_screen->get_settings();

        return 
$settings['use_unmatched_connections'] === 'yes';
    }
}