mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	* initial database migrations * first part, discovery * second part, polling * add SAP polling and discovery * style checks * rename variables in more generic way * html global pages for sdp and sdp binds * add Services and SAPs * port links, database, etc. * html device routing pages * add tests * checks * rework database id relationship * scruntinizer inspection * fix unit test for new mpls tables
		
			
				
	
	
		
			54 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			54 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Models;
 | 
						|
 | 
						|
use Illuminate\Database\Eloquent\Model;
 | 
						|
use LibreNMS\Interfaces\Models\Keyable;
 | 
						|
 | 
						|
class MplsSdpBind extends Model implements Keyable
 | 
						|
{
 | 
						|
    protected $primaryKey = 'bind_id';
 | 
						|
    public $timestamps = false;
 | 
						|
    protected $fillable = [
 | 
						|
        'sdp_id',
 | 
						|
        'svc_id',
 | 
						|
        'sdp_oid',
 | 
						|
        'svc_oid',
 | 
						|
        'device_id',
 | 
						|
        'sdpBindRowStatus',
 | 
						|
        'sdpBindAdminStatus',
 | 
						|
        'sdpBindOperStatus',
 | 
						|
        'sdpBindLastMgmtChange',
 | 
						|
        'sdpBindLastStatusChange',
 | 
						|
        'sdpBindType',
 | 
						|
        'sdpBindVcType',
 | 
						|
        'sdpBindBaseStatsIngFwdPackets',
 | 
						|
        'sdpBindBaseStatsIngFwdOctets',
 | 
						|
        'sdpBindBaseStatsEgrFwdPackets',
 | 
						|
        'sdpBindBaseStatsEgrFwdOctets',
 | 
						|
    ];
 | 
						|
 | 
						|
    // ---- Helper Functions ----
 | 
						|
 | 
						|
    /**
 | 
						|
     * Get a string that can identify a unique instance of this model
 | 
						|
     * @return string
 | 
						|
     */
 | 
						|
    public function getCompositeKey()
 | 
						|
    {
 | 
						|
        return $this->sdp_oid . '-' . $this->svc_oid;
 | 
						|
    }
 | 
						|
 | 
						|
    // ---- Define Relationships ----
 | 
						|
 | 
						|
    public function sdp()
 | 
						|
    {
 | 
						|
        return $this->belongsTo('App\Models\MplsSdp', 'sdp_id');
 | 
						|
    }
 | 
						|
 | 
						|
    public function service()
 | 
						|
    {
 | 
						|
        return $this->belongsTo('App\Models\MplsService', 'svc_id');
 | 
						|
    }
 | 
						|
}
 |