|
@@ -83,12 +83,12 @@ class Host implements WorkflowInterface
|
|
* @JMS\Exclude
|
|
* @JMS\Exclude
|
|
*/
|
|
*/
|
|
protected $currentState = null;
|
|
protected $currentState = null;
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @ORM\Column(type="boolean", nullable=true)
|
|
* @ORM\Column(type="boolean", nullable=true)
|
|
*/
|
|
*/
|
|
protected $fixedIP = false;
|
|
protected $fixedIP = false;
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Host", inversedBy="associatedHosts", fetch="EXTRA_LAZY")
|
|
* @ORM\ManyToOne(targetEntity="Host", inversedBy="associatedHosts", fetch="EXTRA_LAZY")
|
|
* @ORM\JoinColumn(name="host_id", referencedColumnName="id", onDelete="SET NULL")
|
|
* @ORM\JoinColumn(name="host_id", referencedColumnName="id", onDelete="SET NULL")
|
|
@@ -96,7 +96,7 @@ class Host implements WorkflowInterface
|
|
* @JMS\MaxDepth(1)
|
|
* @JMS\MaxDepth(1)
|
|
*/
|
|
*/
|
|
protected $host;
|
|
protected $host;
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Host", mappedBy="host", fetch="EXTRA_LAZY")
|
|
* @ORM\OneToMany(targetEntity="Host", mappedBy="host", fetch="EXTRA_LAZY")
|
|
*
|
|
*
|
|
@@ -118,8 +118,13 @@ class Host implements WorkflowInterface
|
|
*/
|
|
*/
|
|
protected $updated;
|
|
protected $updated;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @ORM\Column(type="boolean", nullable=true)
|
|
|
|
+ */
|
|
|
|
+ protected $mtaEnabled = false;
|
|
|
|
+
|
|
|
|
|
|
- public function __construct()
|
|
|
|
|
|
+ public function __construct()
|
|
{
|
|
{
|
|
$this->associatedHosts = new \Doctrine\Common\Collections\ArrayCollection();
|
|
$this->associatedHosts = new \Doctrine\Common\Collections\ArrayCollection();
|
|
}
|
|
}
|
|
@@ -219,7 +224,7 @@ class Host implements WorkflowInterface
|
|
|
|
|
|
return $this;
|
|
return $this;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @return boolean
|
|
* @return boolean
|
|
*/
|
|
*/
|
|
@@ -227,7 +232,7 @@ class Host implements WorkflowInterface
|
|
{
|
|
{
|
|
return $this->fixedIP;
|
|
return $this->fixedIP;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @param boolean $fixedIP
|
|
* @param boolean $fixedIP
|
|
*
|
|
*
|
|
@@ -236,10 +241,10 @@ class Host implements WorkflowInterface
|
|
public function setFixedIP($fixedIP = null)
|
|
public function setFixedIP($fixedIP = null)
|
|
{
|
|
{
|
|
$this->fixedIP = $fixedIP;
|
|
$this->fixedIP = $fixedIP;
|
|
-
|
|
|
|
|
|
+
|
|
return $this;
|
|
return $this;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @return boolean
|
|
* @return boolean
|
|
*/
|
|
*/
|
|
@@ -247,7 +252,7 @@ class Host implements WorkflowInterface
|
|
{
|
|
{
|
|
return $this->host;
|
|
return $this->host;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @param Host $host
|
|
* @param Host $host
|
|
*
|
|
*
|
|
@@ -256,10 +261,10 @@ class Host implements WorkflowInterface
|
|
public function setHost($host = null)
|
|
public function setHost($host = null)
|
|
{
|
|
{
|
|
$this->host = $host;
|
|
$this->host = $host;
|
|
-
|
|
|
|
|
|
+
|
|
return $this;
|
|
return $this;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @return array<Host>
|
|
* @return array<Host>
|
|
*/
|
|
*/
|
|
@@ -267,7 +272,7 @@ class Host implements WorkflowInterface
|
|
{
|
|
{
|
|
return $this->associatedHosts;
|
|
return $this->associatedHosts;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @return integer
|
|
* @return integer
|
|
*/
|
|
*/
|
|
@@ -291,7 +296,7 @@ class Host implements WorkflowInterface
|
|
function setFixedIntegerAddress()
|
|
function setFixedIntegerAddress()
|
|
{
|
|
{
|
|
$options = $this->getDHCPOption();
|
|
$options = $this->getDHCPOption();
|
|
-
|
|
|
|
|
|
+
|
|
if(isset($options['fixed_address']) && !empty($options['fixed_address'])) {
|
|
if(isset($options['fixed_address']) && !empty($options['fixed_address'])) {
|
|
// IPV4
|
|
// IPV4
|
|
$this->setIpv4Address(ip2long($options['fixed_address']));
|
|
$this->setIpv4Address(ip2long($options['fixed_address']));
|
|
@@ -307,7 +312,7 @@ class Host implements WorkflowInterface
|
|
{
|
|
{
|
|
return $this->updated;
|
|
return $this->updated;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @param integer $updated
|
|
* @param integer $updated
|
|
*
|
|
*
|
|
@@ -319,14 +324,34 @@ class Host implements WorkflowInterface
|
|
|
|
|
|
return $this;
|
|
return $this;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @return boolean
|
|
|
|
+ */
|
|
|
|
+ public function getMtaEnabled()
|
|
|
|
+ {
|
|
|
|
+ return $this->mtaEnabled;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param boolean $mtaEnabled
|
|
|
|
+ *
|
|
|
|
+ * @return Cablemodem
|
|
|
|
+ */
|
|
|
|
+ public function setMtaEnabled($mtaEnabled)
|
|
|
|
+ {
|
|
|
|
+ $this->mtaEnabled = $mtaEnabled;
|
|
|
|
+
|
|
|
|
+ return $this;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @param ExecutionContextInterface $context
|
|
* @param ExecutionContextInterface $context
|
|
*/
|
|
*/
|
|
public function validateFixedAddress(ExecutionContextInterface $context)
|
|
public function validateFixedAddress(ExecutionContextInterface $context)
|
|
{
|
|
{
|
|
global $kernel;
|
|
global $kernel;
|
|
-
|
|
|
|
|
|
+
|
|
if (!$kernel->getContainer()) {
|
|
if (!$kernel->getContainer()) {
|
|
// fix para los tests
|
|
// fix para los tests
|
|
return;
|
|
return;
|
|
@@ -344,7 +369,7 @@ class Host implements WorkflowInterface
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Si el host type es distinto de cablemodem tiene que tener host asociado
|
|
* Si el host type es distinto de cablemodem tiene que tener host asociado
|
|
* @param ExecutionContextInterface $context
|
|
* @param ExecutionContextInterface $context
|