src/Entity/Gos/Timezone.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8.  * @ORM\Table()
  9.  * @ORM\Entity
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class Timezone
  13. {
  14.     /**
  15.      * @ORM\Column(type="integer")
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="IDENTITY")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="boolean", nullable=true)
  22.      */
  23.     private $isActive;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $name;
  28.     /**
  29.      * @Gedmo\Slug(fields={"name"})
  30.      * @ORM\Column(unique=true)
  31.      */
  32.     private $slug;
  33.     /**
  34.      * @ORM\OneToMany(targetEntity="App\Entity\Gos\User", mappedBy="timezone")
  35.      */
  36.     private $user;
  37.     /**
  38.      * @ORM\Column(type="datetime")
  39.      */
  40.     private $createdAt;
  41.     /**
  42.      * @ORM\Column(type="datetime", nullable=true)
  43.      */
  44.     private $updatedAt;
  45.     /** @ORM\PrePersist() */
  46.     public function prePersist()
  47.     {
  48.         $this->createdAt = new \DateTime();
  49.     }
  50.     /** @ORM\PreUpdate() */
  51.     public function preUpdate()
  52.     {
  53.         $this->updatedAt = new \DateTime();
  54.     }
  55.     public function __toString()
  56.     {
  57.         return (string)$this->name;
  58.     }
  59.     /**
  60.      * Constructor
  61.      */
  62.     public function __construct()
  63.     {
  64.         $this->user = new \Doctrine\Common\Collections\ArrayCollection();
  65.     }
  66.     /**
  67.      * Get id
  68.      *
  69.      * @return integer 
  70.      */
  71.     public function getId()
  72.     {
  73.         return $this->id;
  74.     }
  75.     /**
  76.      * Set isActive
  77.      *
  78.      * @param boolean $isActive
  79.      * @return Timezone
  80.      */
  81.     public function setIsActive($isActive)
  82.     {
  83.         $this->isActive $isActive;
  84.         return $this;
  85.     }
  86.     /**
  87.      * Get isActive
  88.      *
  89.      * @return boolean 
  90.      */
  91.     public function getIsActive()
  92.     {
  93.         return $this->isActive;
  94.     }
  95.     /**
  96.      * Set name
  97.      *
  98.      * @param string $name
  99.      * @return Timezone
  100.      */
  101.     public function setName($name)
  102.     {
  103.         $this->name $name;
  104.         return $this;
  105.     }
  106.     /**
  107.      * Get name
  108.      *
  109.      * @return string 
  110.      */
  111.     public function getName()
  112.     {
  113.         return $this->name;
  114.     }
  115.     /**
  116.      * Set slug
  117.      *
  118.      * @param string $slug
  119.      * @return Timezone
  120.      */
  121.     public function setSlug($slug)
  122.     {
  123.         $this->slug $slug;
  124.         return $this;
  125.     }
  126.     /**
  127.      * Get slug
  128.      *
  129.      * @return string 
  130.      */
  131.     public function getSlug()
  132.     {
  133.         return $this->slug;
  134.     }
  135.     /**
  136.      * Set createdAt
  137.      *
  138.      * @param \DateTime $createdAt
  139.      * @return Timezone
  140.      */
  141.     public function setCreatedAt($createdAt)
  142.     {
  143.         $this->createdAt $createdAt;
  144.         return $this;
  145.     }
  146.     /**
  147.      * Get createdAt
  148.      *
  149.      * @return \DateTime 
  150.      */
  151.     public function getCreatedAt()
  152.     {
  153.         return $this->createdAt;
  154.     }
  155.     /**
  156.      * Set updatedAt
  157.      *
  158.      * @param \DateTime $updatedAt
  159.      * @return Timezone
  160.      */
  161.     public function setUpdatedAt($updatedAt)
  162.     {
  163.         $this->updatedAt $updatedAt;
  164.         return $this;
  165.     }
  166.     /**
  167.      * Get updatedAt
  168.      *
  169.      * @return \DateTime 
  170.      */
  171.     public function getUpdatedAt()
  172.     {
  173.         return $this->updatedAt;
  174.     }
  175.     /**
  176.      * Add user
  177.      *
  178.      * @param \App\Entity\Gos\User $user
  179.      * @return Timezone
  180.      */
  181.     public function addUser(\App\Entity\Gos\User $user)
  182.     {
  183.         $this->user[] = $user;
  184.         return $this;
  185.     }
  186.     /**
  187.      * Remove user
  188.      *
  189.      * @param \App\Entity\Gos\User $user
  190.      */
  191.     public function removeUser(\App\Entity\Gos\User $user)
  192.     {
  193.         $this->user->removeElement($user);
  194.     }
  195.     /**
  196.      * Get user
  197.      *
  198.      * @return \Doctrine\Common\Collections\Collection 
  199.      */
  200.     public function getUser()
  201.     {
  202.         return $this->user;
  203.     }
  204. }