|
@@ -0,0 +1,338 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace FTTHBundle\Entity;
|
|
|
+
|
|
|
+use Doctrine\ORM\Mapping as ORM;
|
|
|
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ORM\Entity
|
|
|
+ * @UniqueEntity("ip")
|
|
|
+ */
|
|
|
+class OLT
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var bigint $id
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="bigint", nullable=false)
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\GeneratedValue(strategy="IDENTITY")
|
|
|
+ */
|
|
|
+ private $id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string $name
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true, unique=false)
|
|
|
+ */
|
|
|
+ protected $name;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string $mark
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true, unique=false)
|
|
|
+ */
|
|
|
+ protected $mark;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string $ip
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=50, nullable=false, unique=true)
|
|
|
+ * @Assert\NotNull
|
|
|
+ */
|
|
|
+ protected $ip;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string $snmp_community
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true, unique=false)
|
|
|
+ */
|
|
|
+ protected $snmp_community;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string $ssh_user
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true, unique=false)
|
|
|
+ */
|
|
|
+ protected $ssh_user;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string $ssh_pass
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true, unique=false)
|
|
|
+ */
|
|
|
+ protected $ssh_pass;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string $firmware
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true, unique=false)
|
|
|
+ */
|
|
|
+ protected $firmware;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string $library_version
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true, unique=false)
|
|
|
+ */
|
|
|
+ protected $library_version;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var boolean $execute_snmp
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="boolean", nullable=true, columnDefinition="BOOLEAN DEFAULT TRUE")
|
|
|
+ */
|
|
|
+ protected $execute_snmp = true;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int $tenancyId
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="integer", nullable=false, options={"default":1})
|
|
|
+ */
|
|
|
+ protected $tenancyId = 1;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\OneToMany(targetEntity="ONU", mappedBy="olt")
|
|
|
+ */
|
|
|
+ protected $onus;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function __toString()
|
|
|
+ {
|
|
|
+ return $this->name;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getId()
|
|
|
+ {
|
|
|
+ return $this->id;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getName()
|
|
|
+ {
|
|
|
+ return $this->name;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getMark()
|
|
|
+ {
|
|
|
+ return $this->mark;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getIp()
|
|
|
+ {
|
|
|
+ return $this->ip;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getSnmpCommunity()
|
|
|
+ {
|
|
|
+ return $this->snmp_community;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getSshUser()
|
|
|
+ {
|
|
|
+ return $this->ssh_user;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getSshPass()
|
|
|
+ {
|
|
|
+ return $this->ssh_pass;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getFirmware()
|
|
|
+ {
|
|
|
+ return $this->firmware;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getLibraryVersion()
|
|
|
+ {
|
|
|
+ return $this->library_version;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return boolean
|
|
|
+ */
|
|
|
+ public function getExecuteSnmp()
|
|
|
+ {
|
|
|
+ return $this->execute_snmp;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getTenancyId()
|
|
|
+ {
|
|
|
+ return $this->tenancyId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $name
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setName($name)
|
|
|
+ {
|
|
|
+ $this->name = $name;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $mark
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setMark($mark)
|
|
|
+ {
|
|
|
+ $this->mark = $mark;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $ip
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setIp($ip)
|
|
|
+ {
|
|
|
+ $this->ip = $ip;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $snmp_community
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setSnmpCommunity($snmp_community)
|
|
|
+ {
|
|
|
+ $this->snmp_community = $snmp_community;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $ssh_user
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setSshUser($ssh_user)
|
|
|
+ {
|
|
|
+ $this->ssh_user = $ssh_user;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $ssh_pass
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setSshPass($ssh_pass)
|
|
|
+ {
|
|
|
+ $this->ssh_pass = $ssh_pass;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $firmware
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setFirmware($firmware)
|
|
|
+ {
|
|
|
+ $this->firmware = $firmware;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $library_version
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setLibraryVersion($library_version)
|
|
|
+ {
|
|
|
+ $this->library_version = $library_version;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param boolean $execute_snmp
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setExecuteSnmp($execute_snmp)
|
|
|
+ {
|
|
|
+ $this->execute_snmp = $execute_snmp;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param ONU $onu
|
|
|
+ * @return OLT
|
|
|
+ */
|
|
|
+ public function addOnu(ONU $onu)
|
|
|
+ {
|
|
|
+ $this->onus[] = $onu;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param ONU $onu
|
|
|
+ * @return OLT
|
|
|
+ */
|
|
|
+ public function removeOnu(ONU $onu)
|
|
|
+ {
|
|
|
+ $this->onus->removeElement($onu);
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return Doctrine\Common\Collections\Collection
|
|
|
+ */
|
|
|
+ public function getOnus()
|
|
|
+ {
|
|
|
+ return $this->onus;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param int $tenancyId
|
|
|
+ * @return $this
|
|
|
+ */
|
|
|
+ public function setTenancyId($tenancyId)
|
|
|
+ {
|
|
|
+ $this->tenancyId = $tenancyId;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|