| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 7 | class Variable extends Model |
||
| 8 | { |
||
| 9 | public $table = 'variables'; |
||
| 10 | |||
| 11 | public $timestamps = false; |
||
| 12 | |||
| 13 | public $guarded = ['id']; |
||
| 14 | |||
| 15 | public function __construct(array $attributes = []) |
||
| 20 | } |
||
| 21 | |||
| 22 | protected static function booted() |
||
| 23 | { |
||
| 24 | static::saved(function ($model) { |
||
| 25 | if (config('variables.cache.autoclear')) { |
||
| 26 | app(\Fomvasss\Variable\VariableManagerContract::class)->cacheClear(); |
||
| 27 | } |
||
| 28 | }); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function byLangcode($query, ?string $langcode = null) |
||
| 35 | }); |
||
| 36 | } |
||
| 38 |