|
@@ -143,6 +143,17 @@ class Cablemodem implements DeviceInterface, TenancyIdTraitInterface, LocationIn
|
|
|
*/
|
|
|
protected $mtaEnabled = false;
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="array", nullable=true)
|
|
|
+ *
|
|
|
+ * @Assert\Callback(
|
|
|
+ * callback={"CablemodemBundle\Validator\ArrayValidator", "validate"},
|
|
|
+ * payload={"field"="voip"}
|
|
|
+ * )
|
|
|
+ */
|
|
|
+ protected $voip = null;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @return string
|
|
@@ -351,41 +362,72 @@ class Cablemodem implements DeviceInterface, TenancyIdTraitInterface, LocationIn
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @return boolean
|
|
|
- */
|
|
|
- public function getMtaEnabled()
|
|
|
- {
|
|
|
- return $this->mtaEnabled;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @param boolean $mtaEnabled
|
|
|
- *
|
|
|
- * @return Cablemodem
|
|
|
- */
|
|
|
- public function setMtaEnabled($mtaEnabled)
|
|
|
- {
|
|
|
- $this->mtaEnabled = $mtaEnabled;
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @return string
|
|
|
- */
|
|
|
- public function getDHCPOptions()
|
|
|
- {
|
|
|
- global $kernel;
|
|
|
- $options = [
|
|
|
+ * @return boolean
|
|
|
+ */
|
|
|
+ public function getMtaEnabled()
|
|
|
+ {
|
|
|
+ return $this->mtaEnabled;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param boolean $mtaEnabled
|
|
|
+ *
|
|
|
+ * @return Cablemodem
|
|
|
+ */
|
|
|
+ public function setMtaEnabled($mtaEnabled)
|
|
|
+ {
|
|
|
+ $this->mtaEnabled = $mtaEnabled;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getDHCPOptions()
|
|
|
+ {
|
|
|
+ global $kernel;
|
|
|
+ $options = [
|
|
|
'filename' => $this->mac . '.bin',
|
|
|
- ];
|
|
|
- $container = $kernel->getContainer();
|
|
|
- if ($this->mtaEnabled && $container->hasParameter('dhcp_server_ip')) {
|
|
|
- $options['option122_dhcp_server'] = $container->getParameter('dhcp_server_ip');
|
|
|
- $options['option122_provisioning_type'] = "BASIC.1";
|
|
|
- }
|
|
|
-
|
|
|
- return $options;
|
|
|
- }
|
|
|
+ ];
|
|
|
+ $container = $kernel->getContainer();
|
|
|
+ if ($this->mtaEnabled && $container->hasParameter('dhcp_server_ip')) {
|
|
|
+ $options['option122_dhcp_server'] = $container->getParameter('dhcp_server_ip');
|
|
|
+ $options['option122_provisioning_type'] = "BASIC.1";
|
|
|
+ }
|
|
|
+
|
|
|
+ return $options;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getVoip()
|
|
|
+ {
|
|
|
+ return $this->voip;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param array $voip
|
|
|
+ *
|
|
|
+ * @return Cablemodem
|
|
|
+ */
|
|
|
+ public function setVoip($voip)
|
|
|
+ {
|
|
|
+ if(is_null($voip)) {
|
|
|
+ $this->voip = $voip;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->voip = array_values($voip);
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getVoipData($index)
|
|
|
+ {
|
|
|
+ if(is_null($this->voip)) return null;
|
|
|
+
|
|
|
+ if(isset($this->voip[$index])) return $this->voip[$index];
|
|
|
+ }
|
|
|
|
|
|
}
|