123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <?php
- namespace FTTHBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use JMS\Serializer\Annotation as JMS;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * @ORM\Entity
- * @ORM\Table(name="service_port",
- * uniqueConstraints={
- * @ORM\UniqueConstraint(name="sp_unique",
- * columns={"olt_id", "number"})
- * })
- */
- class ServicePort{
- /**
- * @var int
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @ORM\ManyToOne(targetEntity="\FTTHBundle\Entity\OLT", fetch="EXTRA_LAZY", cascade={"persist"})
- * @JMS\MaxDepth(1)
- */
- protected $olt;
- /**
- * @var int
- *
- * @ORM\Column(type="integer", options={"default": "0"})
- *
- * @Assert\NotNull
- */
- protected $number = 0;
- /**
- * @var int
- *
- * @ORM\Column(type="integer", options={"default": "0"})
- *
- * @Assert\NotNull
- */
- protected $gemport= 0;
- /**
- * @var int
- *
- * @ORM\Column(type="integer", options={"default": "0"})
- *
- * @Assert\NotNull
- */
- protected $vlan = 0;
- /** @ORM\Column(type="string") */
- private $type;
- /**
- * @ORM\ManyToOne(targetEntity="\FTTHBundle\Entity\ONU", fetch="EXTRA_LAZY", cascade={"persist", "remove"})
- * @ORM\JoinColumn(name="onu_id", referencedColumnName="id", onDelete="CASCADE")
- * @JMS\MaxDepth(1)
- */
- protected $onu;
- /**
- * Set number
- *
- * @param integer $number
- *
- * @return ServicePort
- */
- public function setNumber($number)
- {
- $this->number = $number;
- return $this;
- }
- /**
- * Get number
- *
- * @return integer
- */
- public function getNumber()
- {
- return $this->number;
- }
- /**
- * Set type
- *
- * @param string $type
- *
- * @return ServicePort
- */
- public function setType($type)
- {
- $this->type = $type;
- return $this;
- }
- /**
- * Get type
- *
- * @return string
- */
- public function getType()
- {
- return $this->type;
- }
- /**
- * Set olt
- *
- * @param \FTTHBundle\Entity\OLT $olt
- *
- * @return ServicePort
- */
- public function setOlt(\FTTHBundle\Entity\OLT $olt = null)
- {
- $this->olt = $olt;
- return $this;
- }
- /**
- * Get olt
- *
- * @return \FTTHBundle\Entity\OLT
- */
- public function getOlt()
- {
- return $this->olt;
- }
- /**
- * Set onu
- *
- * @param \FTTHBundle\Entity\ONU $onu
- *
- * @return ServicePort
- */
- public function setOnu(\FTTHBundle\Entity\ONU $onu = null)
- {
- $this->onu = $onu;
- return $this;
- }
- /**
- * Get onu
- *
- * @return \FTTHBundle\Entity\ONU
- */
- public function getOnu()
- {
- return $this->onu;
- }
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- public function __toString(){
- return (string)$this->number;
- }
- /**
- * Set gemport
- *
- * @param integer $gemport
- *
- * @return ServicePort
- */
- public function setGemport($gemport)
- {
- $this->gemport = $gemport;
- return $this;
- }
- /**
- * Get gemport
- *
- * @return integer
- */
- public function getGemport()
- {
- return $this->gemport;
- }
- /**
- * Set vlan
- *
- * @param integer $vlan
- *
- * @return ServicePort
- */
- public function setVlan($vlan)
- {
- $this->vlan = $vlan;
- return $this;
- }
- /**
- * Get vlan
- *
- * @return integer
- */
- public function getVlan()
- {
- return $this->vlan;
- }
- }
|