Lines
0.00%
0 / 7
Functions and Methods
0.00%
0 / 1
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Setting | 0.00% | 0 / 7 | 0.00% | 0 / 1 | 12 | 0.00% | 0 / 1 | |||
| fetchName | 0.00% | 0 / 7 | 0.00% | 0 / 1 | 12 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | /** | |
| 4 | * @package ClientDldb | |
| 5 | * @copyright BerlinOnline Stadtportal GmbH & Co. KG | |
| 6 | **/ | |
| 7 | ||
| 8 | namespace BO\Zmsdldb\MySql; | |
| 9 | ||
| 10 | use BO\Zmsdldb\File\Setting as Base; | |
| 11 | ||
| 12 | /** | |
| 13 | * | |
| 14 | */ | |
| 15 | /** @psalm-api */ | |
| 16 | class Setting extends Base | |
| 17 | { | |
| 18 | #[\Override] | |
| 19 | public function fetchName(mixed $name): \BO\Zmsdldb\Entity\Base|string|false|null | |
| 20 | { | |
| 21 | try { | |
| 22 | $sql = 'SELECT value FROM setting WHERE name = ?'; | |
| 23 | ||
| 24 | $stm = $this->access()->prepare($sql); | |
| 25 | $stm->execute([$name]); | |
| 26 | ||
| 27 | $settingValue = $stm->fetchColumn(); | |
| 28 | ||
| 29 | return is_string($settingValue) ? $settingValue : null; | |
| 30 | } catch (\Exception $e) { | |
| 31 | throw $e; | |
| 32 | } | |
| 33 | } | |
| 34 | } |