|
@@ -6,6 +6,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|
|
use Symfony\Component\Workflow\Event\Event;
|
|
|
use Symfony\Component\Workflow\Event\GuardEvent;
|
|
|
+use FTTHBundle\Entity\ONULogOLT;
|
|
|
use WorkflowBundle\Services\ProducerService;
|
|
|
|
|
|
# Ayuda:
|
|
@@ -120,6 +121,11 @@ class EventSubscriber implements EventSubscriberInterface
|
|
|
$object = $event->getSubject();
|
|
|
$objectClass = (string)get_class($object);
|
|
|
if ($objectClass == 'FTTHBundle\\Entity\\ONU') {
|
|
|
+ if (is_null($object->getLogOLT())) {
|
|
|
+ $onuLogOlt = new ONULogOLT();
|
|
|
+ $em->persist($onuLogOlt);
|
|
|
+ $object->setLogOLT($onuLogOlt);
|
|
|
+ }
|
|
|
$object->getLogOLT()->setPending();
|
|
|
$em->flush($object->getLogOLT());
|
|
|
}
|