mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	* Use model::class instead of string for binding Originally from laravel shift Shift bindings PHP 5.5.9+ adds the new static `class` property which provides the fully qualified class name. This is preferred over using class name strings as these references are checked by the parser. * Shift cleanup
		
			
				
	
	
		
			52 lines
		
	
	
		
			976 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			976 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace App\Models;
 | 
						|
 | 
						|
class Route extends DeviceRelatedModel
 | 
						|
{
 | 
						|
    protected $table = 'route';
 | 
						|
    protected $primaryKey = 'route_id';
 | 
						|
    public static $translateProto = [
 | 
						|
        'undefined',
 | 
						|
        'other',
 | 
						|
        'local',
 | 
						|
        'netmgmt',
 | 
						|
        'icmp',
 | 
						|
        'egp',
 | 
						|
        'ggp',
 | 
						|
        'hello',
 | 
						|
        'rip',
 | 
						|
        'isIs',
 | 
						|
        'esIs',
 | 
						|
        'ciscoIgrp',
 | 
						|
        'bbnSpfIgp',
 | 
						|
        'ospf',
 | 
						|
        'bgp',
 | 
						|
        'idpr',
 | 
						|
        'ciscoEigrp',
 | 
						|
        'dvmrp'
 | 
						|
    ];
 | 
						|
 | 
						|
    public static $translateType = [
 | 
						|
        'undefined',
 | 
						|
        'other',
 | 
						|
        'reject',
 | 
						|
        'local',
 | 
						|
        'remote',
 | 
						|
        'blackhole',
 | 
						|
    ];
 | 
						|
 | 
						|
    public $timestamps = true;
 | 
						|
 | 
						|
    // ---- Define Relationships ----
 | 
						|
    public function device()
 | 
						|
    {
 | 
						|
        return $this->belongsTo(\App\Models\Device::class, 'device_id', 'device_id');
 | 
						|
    }
 | 
						|
 | 
						|
    public function port()
 | 
						|
    {
 | 
						|
        return $this->belongsTo(\App\Models\Port::class, 'port_id', 'port_id');
 | 
						|
    }
 | 
						|
}
 |