1 | <?php |
||
11 | class Settings extends Component |
||
12 | { |
||
13 | /** |
||
14 | * @event ModelEvent an event that is triggered before inserting a record. |
||
15 | * You may set [[ModelEvent::isValid]] to be `false` to stop the insertion. |
||
16 | */ |
||
17 | const EVENT_BEFORE_FIND = 'beforeFind'; |
||
18 | /** |
||
19 | * @event ModelEvent an event that is triggered before inserting a record. |
||
20 | * You may set [[ModelEvent::isValid]] to be `false` to stop the insertion. |
||
21 | */ |
||
22 | const EVENT_BEFORE_SAVE = 'beforeSave'; |
||
23 | |||
24 | /** |
||
25 | * @var string Name of the table where configurations will be stored |
||
26 | */ |
||
27 | public $tableName = '{{%settings}}'; |
||
28 | |||
29 | /** |
||
30 | * @var string Name of column where keys will be stored |
||
31 | */ |
||
32 | public $keyColumnName = 'key'; |
||
33 | |||
34 | /** |
||
35 | * @var string Name of column where values will be stored |
||
36 | */ |
||
37 | public $valueColumnName = 'value'; |
||
38 | |||
39 | /** |
||
40 | * @return Connection the DB connection instance |
||
41 | */ |
||
42 | 2 | protected function getDb() |
|
46 | |||
47 | /** |
||
48 | * Whether the configuration exists in the database |
||
49 | * @param string $name configuration name |
||
50 | * @param integer $tenantId The tenant id value |
||
|
|||
51 | * @return bool |
||
52 | */ |
||
53 | 2 | protected function exists($name) |
|
58 | |||
59 | /** |
||
60 | * Returns configuration value from database |
||
61 | * @param string $name configuration name |
||
62 | * @param mixed $defaultValue the default value to be returned when the session variable does not exist. |
||
63 | * @return string value stored in database |
||
64 | */ |
||
65 | 1 | public function get($name, $defaultValue = null) |
|
79 | |||
80 | /** |
||
81 | * Store configuration value to database |
||
82 | * @param string $name |
||
83 | * @param mixed $value |
||
84 | * @param integer $tenantId The tenant id value |
||
85 | */ |
||
86 | 2 | public function set($name, $value, $tenantId = null) |
|
108 | |||
109 | /** |
||
110 | * Retrieves all configurations stored in database |
||
111 | * @param integer $tenantId |
||
112 | * @return array |
||
113 | */ |
||
114 | 1 | public function all() |
|
129 | |||
130 | /** |
||
131 | * Store all configuration in database |
||
132 | * @param array $names |
||
133 | */ |
||
134 | 1 | public function save($names) |
|
140 | |||
141 | /** |
||
142 | * Deletes specified configurations (or all if none specified) from the parameters table |
||
143 | * @param array|string $names |
||
144 | * @param integer $tenantId |
||
145 | */ |
||
146 | 1 | public function delete($names = []) |
|
166 | |||
167 | /** |
||
168 | * Creates query to find settings value |
||
169 | * @param string $name |
||
170 | * @return \yii\db\Query |
||
171 | */ |
||
172 | 2 | protected function createQuery($name = null) |
|
191 | |||
192 | } |
||
193 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.