src/Aviatur/HotelBundle/Entity/Hotel.php line 13

Open in your IDE?
  1. <?php
  2. namespace Aviatur\HotelBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Hotel.
  6.  *
  7.  * @ORM\Table(name="hotel")
  8.  * @ORM\Entity
  9.  */
  10. class Hotel
  11. {
  12.     /**
  13.      * @var int
  14.      *
  15.      * @ORM\Column(name="id", type="integer", nullable=false)
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="IDENTITY")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @var string
  22.      *
  23.      * @ORM\Column(name="codHotel", type="string", length=100, nullable=false)
  24.      */
  25.     private $codhotel;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="description", type="string", length=255, nullable=false)
  30.      */
  31.     private $description;
  32.     /**
  33.      * @ORM\OneToMany(targetEntity="Aviatur\HotelBundle\Entity\Markup", mappedBy="hotel", cascade={"all"})
  34.      */
  35.     private $markup;
  36.     public function __toString()
  37.     {
  38.         $return $this->getDescription().' ('.$this->getCodhotel().')';
  39.         return $return;
  40.     }
  41.     /**
  42.      * @var float
  43.      *
  44.      * @ORM\Column(name="markup_value", type="float", precision=10, scale=0, nullable=false)
  45.      */
  46.     private $markupValue;
  47.     /**
  48.      * Get id.
  49.      *
  50.      * @return int
  51.      */
  52.     public function getId()
  53.     {
  54.         return $this->id;
  55.     }
  56.     /**
  57.      * Set codhotel.
  58.      *
  59.      * @param string $codhotel
  60.      *
  61.      * @return Hotel
  62.      */
  63.     public function setCodhotel($codhotel)
  64.     {
  65.         $this->codhotel $codhotel;
  66.         return $this;
  67.     }
  68.     /**
  69.      * Get codhotel.
  70.      *
  71.      * @return string
  72.      */
  73.     public function getCodhotel()
  74.     {
  75.         return $this->codhotel;
  76.     }
  77.     /**
  78.      * Set description.
  79.      *
  80.      * @param string $description
  81.      *
  82.      * @return Hotel
  83.      */
  84.     public function setDescription($description)
  85.     {
  86.         $this->description $description;
  87.         return $this;
  88.     }
  89.     /**
  90.      * Get description.
  91.      *
  92.      * @return string
  93.      */
  94.     public function getDescription()
  95.     {
  96.         return $this->description;
  97.     }
  98.     /**
  99.      * Constructor.
  100.      */
  101.     public function __construct()
  102.     {
  103.         $this->markup = new \Doctrine\Common\Collections\ArrayCollection();
  104.     }
  105.     /**
  106.      * Add markup.
  107.      *
  108.      * @return Hotel
  109.      */
  110.     public function addMarkup(\Aviatur\HotelBundle\Entity\Markup $markup)
  111.     {
  112.         $this->markup[] = $markup;
  113.         return $this;
  114.     }
  115.     /**
  116.      * Remove markup.
  117.      */
  118.     public function removeMarkup(\Aviatur\HotelBundle\Entity\Markup $markup)
  119.     {
  120.         $this->markup->removeElement($markup);
  121.     }
  122.     /**
  123.      * Get markup.
  124.      *
  125.      * @return \Doctrine\Common\Collections\Collection
  126.      */
  127.     public function getMarkup()
  128.     {
  129.         return $this->markup;
  130.     }
  131.     /**
  132.      * Get markupValue.
  133.      *
  134.      * @return float
  135.      */
  136.     public function getMarkupValue()
  137.     {
  138.         return $this->markupValue;
  139.     }
  140. }