|
@@ -9,6 +9,7 @@ use Buzz\Message\RequestInterface as HttpRequestInterface;
|
|
|
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
|
|
use Symfony\Component\Console\Input\ArrayInput;
|
|
|
use Symfony\Component\Console\Output\BufferedOutput;
|
|
|
+use Base\AdminBundle\Interfaces\SoftDeleteInterface;
|
|
|
|
|
|
class DeviceListener
|
|
|
{
|
|
@@ -63,6 +64,11 @@ class DeviceListener
|
|
|
}
|
|
|
|
|
|
$entity = $args->getEntity();
|
|
|
+
|
|
|
+ if($entity instanceof SoftDeleteInterface && $entity->isDeleted()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if ($entity instanceof DeviceInterface) {
|
|
|
$cmd_args = array(
|
|
|
'--type:' . get_class($entity),
|
|
@@ -85,6 +91,7 @@ class DeviceListener
|
|
|
*/
|
|
|
public function runCommand($name, $cmd_args = array())
|
|
|
{
|
|
|
+
|
|
|
$kernel = $this->serviceContainer->get('kernel');
|
|
|
|
|
|
$application = new Application($kernel);
|
|
@@ -116,7 +123,9 @@ class DeviceListener
|
|
|
}
|
|
|
|
|
|
$entity = $args->getEntity();
|
|
|
+
|
|
|
if ($entity instanceof DeviceInterface) {
|
|
|
+ var_dump(get_class($entity).PHP_EOL);
|
|
|
if ($deviceId = $this->getRemoteDeviceId($entity)) {
|
|
|
$cmd_args = array(
|
|
|
'--type:' . get_class($entity),
|
|
@@ -128,6 +137,8 @@ class DeviceListener
|
|
|
return $this->runCommand('device:crud', $cmd_args);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -140,6 +151,11 @@ class DeviceListener
|
|
|
}
|
|
|
|
|
|
$entity = $args->getEntity();
|
|
|
+
|
|
|
+ if($entity instanceof SoftDeleteInterface && $entity->isDeleted()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if ($entity instanceof DeviceInterface) {
|
|
|
$cmd_args = array(
|
|
|
'--type:' . get_class($entity),
|
|
@@ -152,6 +168,8 @@ class DeviceListener
|
|
|
|
|
|
return $this->runCommand('device:crud', $cmd_args);
|
|
|
}
|
|
|
+
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
/**
|