src/Entity/HorarioReducido.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /** @ORM\Table(name="oficina_dayoff_horario")
  5.  * @ORM\Entity(repositoryClass="App\Repository\HorarioReducidoRepository")
  6.  */
  7. class HorarioReducido
  8. {
  9.     /**
  10.      * @var integer
  11.      *
  12.      * @ORM\Column(name="id", type="integer")
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue(strategy="AUTO")
  15.      */
  16.     private $id;
  17.     
  18.     /**
  19.      * @var \DateTime
  20.      *
  21.      * @ORM\Column(name="horaInicio", type="time", nullable=true)
  22.      */
  23.     private $horaInicio;
  24.     /**
  25.      * @var \DateTime
  26.      *
  27.      * @ORM\Column(name="horaFin", type="time", nullable=true)
  28.      */
  29.     private $horaFin;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="DayOff")
  32.      * @ORM\JoinColumn(name="dayoff_id", referencedColumnName="id", nullable=false)
  33.      */
  34.     protected $dayoff;
  35.     
  36.     /**
  37.      * @var boolean
  38.      *
  39.      * @ORM\Column(name="festivo", type="boolean")
  40.      */
  41. //     private $festivo=0;
  42.     public function __construct()
  43.     {
  44.         $this->horaInicio = new \DateTime('00:00:00');
  45.         $this->horaFin = new \DateTime('00:00:00');
  46.     }
  47.     public function __toString()
  48.     {
  49.         return $this->getDayoff()->getDate()->format('Y-m-d');
  50.     }
  51.     
  52.     /**
  53.      * Get id
  54.      *
  55.      * @return integer 
  56.      */
  57.     public function getId()
  58.     {
  59.         return $this->id;
  60.     }
  61.     /**
  62.      * Set horaInicio
  63.      *
  64.      * @param \DateTime $horaInicio
  65.      * @return HorarioReducido
  66.      */
  67.     public function setHoraInicio($horaInicio)
  68.     {
  69.         $this->horaInicio $horaInicio;
  70.         return $this;
  71.     }
  72.     /**
  73.      * Get horaInicio
  74.      *
  75.      * @return \DateTime
  76.      */
  77.     public function getHoraInicio()
  78.     {
  79.         return $this->horaInicio;
  80.     }
  81.     /**
  82.      * Set horaFin
  83.      *
  84.      * @param \DateTime $horaFin
  85.      * @return HorarioReducido
  86.      */
  87.     public function setHoraFin($horaFin)
  88.     {
  89.         $this->horaFin $horaFin;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Get horaFin
  94.      *
  95.      * @return \DateTime
  96.      */
  97.     public function getHoraFin()
  98.     {
  99.         return $this->horaFin;
  100.     }
  101.     /**
  102.      * @return mixed
  103.      */
  104.     public function getDayoff()
  105.     {
  106.         return $this->dayoff;
  107.     }
  108.     /**
  109.      * @param mixed $dayoff
  110.      */
  111.     public function setDayoff($dayoff)
  112.     {
  113.         $this->dayoff $dayoff;
  114.     }
  115.     
  116.     
  117.     /**
  118.      * Set festivo
  119.      *
  120.      * @param bool $festivo
  121.      * @return bool
  122.      */
  123.     public function setFestivo($festivo)
  124.     {
  125.         $this->festivo $festivo;
  126.         return $this;
  127.     }
  128.     /**
  129.     * Get festivo
  130.     *
  131.     * @return bool
  132.     */
  133.     public function getFestivo()
  134.     {
  135.         return $this->festivo;
  136.     }
  137. }