SystemSetterTrait.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Matomo - free/libre analytics platform |
| 5 | * |
| 6 | * @link https://matomo.org |
| 7 | * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 8 | */ |
| 9 | namespace Piwik\Settings\Interfaces\Traits\Setters; |
| 10 | |
| 11 | use Piwik\Settings\Interfaces\Traits\Getters\SystemGetterTrait; |
| 12 | /** |
| 13 | * @template T of mixed |
| 14 | */ |
| 15 | trait SystemSetterTrait |
| 16 | { |
| 17 | /** |
| 18 | * @use SystemGetterTrait<T> |
| 19 | */ |
| 20 | use SystemGetterTrait; |
| 21 | /** |
| 22 | * @param T $value |
| 23 | */ |
| 24 | public static function setSystemValue($value) : void |
| 25 | { |
| 26 | $setting = self::getSystemSetting(); |
| 27 | $setting->setValue($value); |
| 28 | $setting->save(); |
| 29 | } |
| 30 | } |
| 31 |