|
@@ -2,6 +2,8 @@
|
|
|
|
|
|
namespace KeaBundle\Services;
|
|
|
|
|
|
+use KeaBundle\Interfaces\KeaConfigInterface;
|
|
|
+
|
|
|
class KeaConfigService
|
|
|
{
|
|
|
|
|
@@ -43,14 +45,16 @@ class KeaConfigService
|
|
|
$config = '';
|
|
|
$fullClass = 'KeaBundle\\Services\\' . $className;
|
|
|
if (class_exists($fullClass)) {
|
|
|
- $data = [
|
|
|
- 'dhcp' => $this->dhcpRepository->find($id),
|
|
|
- 'hosts' => $this->hostRepository->findAll(),
|
|
|
- 'subnets' => $this->subnetRepository->findAll(),
|
|
|
- 'library' => $library,
|
|
|
- ];
|
|
|
$keaConfig = new $fullClass;
|
|
|
- $config = $keaConfig->getConfig($data);
|
|
|
+ if ($keaConfig instanceof KeaConfigInterface) {
|
|
|
+ $data = [
|
|
|
+ 'dhcp' => $this->dhcpRepository->find($id),
|
|
|
+ 'hosts' => $this->hostRepository->findAll(),
|
|
|
+ 'subnets' => $this->subnetRepository->findAll(),
|
|
|
+ 'library' => $library,
|
|
|
+ ];
|
|
|
+ $config = $keaConfig->getConfig($data);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return $config;
|