]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Slot.php
Rename end field in length
[airbundle] / Entity / Slot.php
index 03bfd3f8e929e528aebe2806a676fc10117e34a6..a46fd0bedf5c42719d84ce19995e24f5e2676df3 100644 (file)
@@ -5,187 +5,151 @@ namespace Rapsys\AirBundle\Entity;
 /**
  * Slot
  */
-class Slot
-{
-    /**
-     * @var integer
-     */
-    private $id;
-
-    /**
-     * @var \DateTime
-     */
-    private $begin;
-
-    /**
-     * @var \DateTime
-     */
-    private $end;
-
-    /**
-     * @var \DateTime
-     */
-    private $created;
-
-    /**
-     * @var \DateTime
-     */
-    private $updated;
-
-    /**
-     * @var \Doctrine\Common\Collections\Collection
-     */
-    private $sessions;
-
-    /**
-     * Constructor
-     */
-    public function __construct()
-    {
-        $this->sessions = new \Doctrine\Common\Collections\ArrayCollection();
-    }
-
-    /**
-     * Get id
-     *
-     * @return integer
-     */
-    public function getId()
-    {
-        return $this->id;
-    }
-
-    /**
-     * Set begin
-     *
-     * @param \DateTime $begin
-     *
-     * @return Slot
-     */
-    public function setBegin($begin)
-    {
-        $this->begin = $begin;
-
-        return $this;
-    }
-
-    /**
-     * Get begin
-     *
-     * @return \DateTime
-     */
-    public function getBegin()
-    {
-        return $this->begin;
-    }
-
-    /**
-     * Set end
-     *
-     * @param \DateTime $end
-     *
-     * @return Slot
-     */
-    public function setEnd($end)
-    {
-        $this->end = $end;
-
-        return $this;
-    }
-
-    /**
-     * Get end
-     *
-     * @return \DateTime
-     */
-    public function getEnd()
-    {
-        return $this->end;
-    }
-
-    /**
-     * Set created
-     *
-     * @param \DateTime $created
-     *
-     * @return Slot
-     */
-    public function setCreated($created)
-    {
-        $this->created = $created;
-
-        return $this;
-    }
-
-    /**
-     * Get created
-     *
-     * @return \DateTime
-     */
-    public function getCreated()
-    {
-        return $this->created;
-    }
-
-    /**
-     * Set updated
-     *
-     * @param \DateTime $updated
-     *
-     * @return Slot
-     */
-    public function setUpdated($updated)
-    {
-        $this->updated = $updated;
-
-        return $this;
-    }
-
-    /**
-     * Get updated
-     *
-     * @return \DateTime
-     */
-    public function getUpdated()
-    {
-        return $this->updated;
-    }
-
-    /**
-     * Add session
-     *
-     * @param \Rapsys\AirBundle\Entity\Session $session
-     *
-     * @return Slot
-     */
-    public function addSession(\Rapsys\AirBundle\Entity\Session $session)
-    {
-        $this->sessions[] = $session;
-
-        return $this;
-    }
-
-    /**
-     * Remove session
-     *
-     * @param \Rapsys\AirBundle\Entity\Session $session
-     */
-    public function removeSession(\Rapsys\AirBundle\Entity\Session $session)
-    {
-        $this->sessions->removeElement($session);
-    }
-
-    /**
-     * Get sessions
-     *
-     * @return \Doctrine\Common\Collections\Collection
-     */
-    public function getSessions()
-    {
-        return $this->sessions;
-    }
-
-    public function getTitle() {
-           return $this->begin->format('H:i').'-'.$this->end->format('H:i');
-    }
+class Slot {
+       /**
+        * @var integer
+        */
+       private $id;
+
+       /**
+        * @var string
+        */
+       protected $title;
+
+       /**
+        * @var \DateTime
+        */
+       private $created;
+
+       /**
+        * @var \DateTime
+        */
+       private $updated;
+
+       /**
+        * @var \Doctrine\Common\Collections\Collection
+        */
+       private $sessions;
+
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               $this->sessions = new \Doctrine\Common\Collections\ArrayCollection();
+       }
+
+       /**
+        * Get id
+        *
+        * @return integer
+        */
+       public function getId() {
+               return $this->id;
+       }
+
+       /**
+        * Set title
+        *
+        * @param string $title
+        *
+        * @return Title
+        */
+       public function setTitle($title) {
+               $this->title = $title;
+
+               return $this;
+       }
+
+       /**
+        * Get title
+        *
+        * @return string
+        */
+       public function getTitle(): string {
+               return $this->title;
+       }
+
+       /**
+        * Set created
+        *
+        * @param \DateTime $created
+        *
+        * @return Slot
+        */
+       public function setCreated($created) {
+               $this->created = $created;
+
+               return $this;
+       }
+
+       /**
+        * Get created
+        *
+        * @return \DateTime
+        */
+       public function getCreated() {
+               return $this->created;
+       }
+
+       /**
+        * Set updated
+        *
+        * @param \DateTime $updated
+        *
+        * @return Slot
+        */
+       public function setUpdated($updated) {
+               $this->updated = $updated;
+
+               return $this;
+       }
+
+       /**
+        * Get updated
+        *
+        * @return \DateTime
+        */
+       public function getUpdated() {
+               return $this->updated;
+       }
+
+       /**
+        * Add session
+        *
+        * @param \Rapsys\AirBundle\Entity\Session $session
+        *
+        * @return Slot
+        */
+       public function addSession(\Rapsys\AirBundle\Entity\Session $session) {
+               $this->sessions[] = $session;
+
+               return $this;
+       }
+
+       /**
+        * Remove session
+        *
+        * @param \Rapsys\AirBundle\Entity\Session $session
+        */
+       public function removeSession(\Rapsys\AirBundle\Entity\Session $session) {
+               $this->sessions->removeElement($session);
+       }
+
+       /**
+        * Get sessions
+        *
+        * @return \Doctrine\Common\Collections\Collection
+        */
+       public function getSessions() {
+               return $this->sessions;
+       }
+
+       /**
+        * Returns a string representation of the slot
+        *
+        * @return string
+        */
+       public function __toString(): string {
+               return $this->title;
+       }
 }