src/Entity/Support.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTimeImmutable;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\SupportRepository")
  8.  * @ORM\HasLifecycleCallbacks()
  9.  */
  10. class Support
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $subject;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $classification;
  26.     /**
  27.      * @ORM\Column(type="text")
  28.      */
  29.     private $description;
  30.     /**
  31.      * @ORM\Column(type="string", length=255)
  32.      */
  33.     private $customerName;
  34.     /**
  35.      * @ORM\Column(type="string", length=255)
  36.      * @Assert\NotBlank(message="Please provide email")
  37.      * @Assert\Email(
  38.      *     message = "Please enter valid email."
  39.      * )
  40.      */
  41.     private $customerEmail;
  42.     /**
  43.      * @ORM\Column(type="datetime_immutable")
  44.      */
  45.     private $created;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity="App\Entity\Workspace", inversedBy="supports")
  48.      * @ORM\JoinColumn(nullable=false)
  49.      */
  50.     private $workspace;
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="supports")
  53.      * @ORM\JoinColumn(nullable=false)
  54.      **/
  55.     private $user;
  56.     public function __construct()
  57.     {
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     /**
  64.      * @return string|null
  65.      */
  66.     public function getSubject(): ?string
  67.     {
  68.         return $this->subject;
  69.     }
  70.     /**
  71.      * @param string $subject
  72.      *
  73.      * @return $this
  74.      */
  75.     public function setSubject(string $subject): self
  76.     {
  77.         $this->subject $subject;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @return string|null
  82.      */
  83.     public function getClassification(): ?string
  84.     {
  85.         return $this->classification;
  86.     }
  87.     /**
  88.      * @param string $classification
  89.      *
  90.      * @return $this
  91.      */
  92.     public function setClassification(string $classification): self
  93.     {
  94.         $this->classification $classification;
  95.         return $this;
  96.     }
  97.     /**
  98.      * @return string|null
  99.      */
  100.     public function getDescription(): ?string
  101.     {
  102.         return $this->description;
  103.     }
  104.     /**
  105.      * @param string $description
  106.      *
  107.      * @return $this
  108.      */
  109.     public function setDescription(string $description): self
  110.     {
  111.         $this->description $description;
  112.         return $this;
  113.     }
  114.     /**
  115.      * @return string|null
  116.      */
  117.     public function getCustomerEmail(): ?string
  118.     {
  119.         return $this->customerEmail;
  120.     }
  121.     /**
  122.      * @param string $customerEmail
  123.      *
  124.      * @return $this
  125.      */
  126.     public function setCustomerEmail(string $customerEmail): self
  127.     {
  128.         $this->customerEmail $customerEmail;
  129.         return $this;
  130.     }
  131.     /**
  132.      * @return string|null
  133.      */
  134.     public function getCustomerName(): ?string
  135.     {
  136.         return $this->customerName;
  137.     }
  138.     /**
  139.      * @param string $customerName
  140.      *
  141.      * @return $this
  142.      */
  143.     public function setCustomerName(string $customerName): self
  144.     {
  145.         $this->customerName $customerName;
  146.         return $this;
  147.     }
  148.     /**
  149.      * @return DateTimeImmutable|null
  150.      */
  151.     public function getCreated(): ?DateTimeImmutable
  152.     {
  153.         return $this->created;
  154.     }
  155.     /**
  156.      * @param DateTimeImmutable $created
  157.      *
  158.      * @return $this
  159.      */
  160.     public function setCreated(DateTimeImmutable $created): self
  161.     {
  162.         $this->created $created;
  163.         return $this;
  164.     }
  165.     /**
  166.      * Set user
  167.      *
  168.      * @param User|null $user
  169.      * @return Support
  170.      */
  171.     public function setUser(?User $user null): self
  172.     {
  173.         $this->user $user;
  174.         return $this;
  175.     }
  176.     /**
  177.      * @return User|null
  178.      */
  179.     public function getUser(): ?User
  180.     {
  181.         return $this->user;
  182.     }
  183.     /**
  184.      * @return Workspace|null
  185.      */
  186.     public function getWorkspace(): ?Workspace
  187.     {
  188.         return $this->workspace;
  189.     }
  190.     /**
  191.      * @param Workspace|null $workspace
  192.      */
  193.     public function setWorkspace(?Workspace $workspace): void
  194.     {
  195.         $this->workspace $workspace;
  196.     }
  197.     /**
  198.      * @ORM\PrePersist
  199.      */
  200.     public function setCreatedValue()
  201.     {
  202.         $this->created = new DateTimeImmutable();
  203.     }
  204. }