Selaa lähdekoodia

fix onu log olt

Guillermo Espinoza 6 vuotta sitten
vanhempi
commit
d796f144cc
2 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 2 2
      composer.lock
  2. 7 1
      src/FTTHBundle/Entity/ONU.php

+ 2 - 2
composer.lock

@@ -2223,7 +2223,7 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/WorkflowBundle.git",
-                "reference": "0ea49ae3beac63db664b7275a546cd989eceb909"
+                "reference": "77ab873525af0143607aa1b390d7bb451c6cb548"
             },
             "require": {
                 "php-amqplib/rabbitmq-bundle": "^1.12"
@@ -2253,7 +2253,7 @@
                 "bundle",
                 "workflow"
             ],
-            "time": "2019-06-05T11:16:53+00:00"
+            "time": "2019-06-06T18:12:17+00:00"
         },
         {
             "name": "incenteev/composer-parameter-handler",

+ 7 - 1
src/FTTHBundle/Entity/ONU.php

@@ -1072,11 +1072,13 @@ class ONU implements DeviceInterface, TenancyIdTraitInterface, LocationInterface
 
     /**
      * @param mixed $logOLT
+     * 
      * @return $this
      */
     public function setLogOLT($logOLT)
     {
         $this->logOLT = $logOLT;
+
         return $this;
     }
 
@@ -1086,7 +1088,7 @@ class ONU implements DeviceInterface, TenancyIdTraitInterface, LocationInterface
     public function prePersist()
     {
         $this->correctSerialNumber();
-        $this->setLogOLT(new  ONULogOLT());
+        $this->setLogOLT(new ONULogOLT());
     }
 
     /**
@@ -1095,6 +1097,10 @@ class ONU implements DeviceInterface, TenancyIdTraitInterface, LocationInterface
     public function preUpdate()
     {
         $this->correctSerialNumber();
+
+        if (is_null($this->logOLT)) {
+            $this->setLogOLT(new ONULogOLT());
+        }
     }
 
     public function correctSerialNumber() {