Files
librenms-librenms/app/Models/MplsLspPath.php
Jellyfrog 36e54ab9f1 Use model::class instead of string for binding (#11450)
* 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
2020-04-21 07:28:48 -05:00

53 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use LibreNMS\Interfaces\Models\Keyable;
class MplsLspPath extends Model implements Keyable
{
protected $primaryKey = 'lsp_path_id';
public $timestamps = false;
protected $fillable = [
'lsp_id',
'path_oid',
'device_id',
'mplsLspPathRowStatus',
'mplsLspPathLastChange',
'mplsLspPathType',
'mplsLspPathBandwidth',
'mplsLspPathOperBandwidth',
'mplsLspPathAdminState',
'mplsLspPathOperState',
'mplsLspPathState',
'mplsLspPathFailCode',
'mplsLspPathFailNodeAddr',
'mplsLspPathMetric',
'mplsLspPathOperMetric',
'mplsLspPathTimeUp',
'mplsLspPathTimeDown',
'mplsLspPathTransitionCount',
'mplsLspPathTunnelARHopListIndex',
'mplsLspPathTunnelCHopListIndex',
];
// ---- Helper Functions ----
/**
* Get a string that can identify a unique instance of this model
* @return string
*/
public function getCompositeKey()
{
return $this->lsp_id . '-' . $this->path_oid;
}
// ---- Define Relationships ----
public function lsp()
{
return $this->belongsTo(\App\Models\MplsLsp::class, 'lsp_id');
}
}