mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	* 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.
		
			
				
	
	
		
			17 lines
		
	
	
		
			357 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			357 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?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;
 | 
						|
    }
 | 
						|
}
 |