MPLS Services (#10421)

* 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
This commit is contained in:
Vitali Kari
2019-07-28 06:11:04 +02:00
committed by Tony Murray
parent 60c538ad8c
commit 1de640c3aa
20 changed files with 6774 additions and 43 deletions

View File

@@ -41,14 +41,14 @@ trait SyncsModels
$models = $models->keyBy->getCompositeKey();
$existing = $device->$relationship->keyBy->getCompositeKey();
foreach ($existing as $key => $existing_lsp) {
if ($models->offsetExists($key)) {
foreach ($existing as $exist_key => $exist_value) {
if ($models->offsetExists($exist_key)) {
// update
$existing_lsp->fill($models->get($key)->getAttributes())->save();
$exist_value->fill($models->get($exist_key)->getAttributes())->save();
} else {
// delete
$existing_lsp->delete();
$existing->forget($key);
$exist_value->delete();
$existing->forget($exist_key);
}
}