2019-07-28 06:11:04 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2021-03-31 17:28:47 +02:00
|
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
2019-07-28 06:11:04 +02:00
|
|
|
use LibreNMS\Interfaces\Models\Keyable;
|
|
|
|
|
|
|
|
class MplsSdp extends Model implements Keyable
|
|
|
|
{
|
|
|
|
protected $primaryKey = 'sdp_id';
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
|
|
'sdp_oid',
|
|
|
|
'device_id',
|
|
|
|
'sdpRowStatus',
|
|
|
|
'sdpDelivery',
|
|
|
|
'sdpDescription',
|
|
|
|
'sdpAdminStatus',
|
|
|
|
'sdpOperStatus',
|
|
|
|
'sdpAdminPathMtu',
|
|
|
|
'sdpOperPathMtu',
|
|
|
|
'sdpLastMgmtChange',
|
|
|
|
'sdpLastStatusChange',
|
|
|
|
'sdpActiveLspType',
|
|
|
|
'sdpFarEndInetAddressType',
|
|
|
|
'sdpFarEndInetAddress',
|
|
|
|
];
|
|
|
|
|
|
|
|
// ---- Helper Functions ----
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a string that can identify a unique instance of this model
|
2021-09-10 20:09:53 +02:00
|
|
|
*
|
2021-03-28 19:18:47 +02:00
|
|
|
* @return int
|
2019-07-28 06:11:04 +02:00
|
|
|
*/
|
|
|
|
public function getCompositeKey()
|
|
|
|
{
|
|
|
|
return $this->sdp_oid;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---- Define Relationships ----
|
|
|
|
|
2021-03-31 17:28:47 +02:00
|
|
|
public function binds(): HasMany
|
2019-07-28 06:11:04 +02:00
|
|
|
{
|
2020-04-21 14:28:48 +02:00
|
|
|
return $this->hasMany(\App\Models\MplsSdpBind::class, 'sdp_id');
|
2019-07-28 06:11:04 +02:00
|
|
|
}
|
|
|
|
}
|