Completed
Push — master ( 099bee...470be9 )
by WEBEWEB
01:42
created

AbstractDatabase::getDatabase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2017 NdC/WBW
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\Database;
13
14
/**
15
 * Abstract database.
16
 *
17
 * @author NdC/WBW <https://github.com/webeweb/>
18
 * @package WBW\Library\Core\Database
19
 */
20
abstract class AbstractDatabase {
21
22
    /**
23
     * Database.
24
     *
25
     * @var string
26
     */
27
    private $database;
28
29
    /**
30
     * Password.
31
     *
32
     * @var string
33
     */
34
    private $password;
35
36
    /**
37
     * Username.
38
     *
39
     * @var string
40
     */
41
    private $username;
42
43
    /**
44
     * Constructor.
45
     */
46
    protected function __construct() {
47
        // NOTHING TO DO.
48
    }
49
50
    /**
51
     * Get the database.
52
     *
53
     * @return string Returns the database.
54
     */
55
    final public function getDatabase() {
56
        return $this->database;
57
    }
58
59
    /**
60
     * Get the paswword.
61
     *
62
     * @return string Returns the password.
63
     */
64
    final public function getPassword() {
65
        return $this->password;
66
    }
67
68
    /**
69
     * Get the username.
70
     *
71
     * @return string Returns the username.
72
     */
73
    final public function getUsername() {
74
        return $this->username;
75
    }
76
77
    /**
78
     * Set the database.
79
     *
80
     * @param string $database The database.
81
     * @return AbstractDatabase Returns the database.
82
     */
83
    final public function setDatabase($database) {
84
        $this->database = $database;
85
        return $this;
86
    }
87
88
    /**
89
     * Set the password.
90
     *
91
     * @param string $password The password.
92
     * @return AbstractDatabase Returns the database.
93
     */
94
    final public function setPassword($password) {
95
        $this->password = $password;
96
        return $this;
97
    }
98
99
    /**
100
     * Set the username.
101
     *
102
     * @param string $username The username.
103
     * @return AbstractDatabase Returns the database.
104
     */
105
    final public function setUsername($username) {
106
        $this->username = $username;
107
        return $this;
108
    }
109
110
}
111