Logo
Explore Help
Sign In
mirror/librenms-librenms
1
0
Fork 0
You've already forked librenms-librenms
mirror of https://github.com/librenms/librenms.git synced 2024-10-07 16:52:45 +00:00
Code Issues Actions Packages Projects Releases Wiki Activity
Files
master
librenms-librenms/app/Models/ComponentPref.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
358 B
PHP
Raw Permalink Normal View History

Fix errors for some devices loading components (#11527) * Test WIP * WIP * port getComponents to Eloquent * port more * simpler creation * change to explicit arrays * add missed file * restore commented code * fix inserting null value for component prefs * Fix some bugs in setCompenentPrefs Can't create tests without fixing bugs first :D * another test * another test * Modernize setComponentPrefs * Test for event log entries * Fix delete event * fix invalid values for component toggles * status log too * Use Setters to work around bad data, $casts doesn't do what we want.
2020-05-08 00:30:56 -05:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ComponentPref extends Model
{
public $timestamps = false;
protected $fillable = ['component', 'attribute', 'value'];
public function setValueAttribute($value)
{
$this->attributes['value'] = is_array($value) ? json_encode($value) : (string) $value;
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Page: 1235ms Template: 2ms
edge-auto
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API