src/Entity/UserIdentityForm.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\BlogPost;
  4. use App\Entity\User;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\UserIdentityFormRepository")
  10.  * @Vich\Uploadable
  11.  */
  12. class UserIdentityForm
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=BlogPost::class, inversedBy="userIdentityForms")
  22.      * @ORM\JoinColumn(nullable=false)
  23.      */
  24.     private $blogPost;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=User::class)
  27.      * @ORM\JoinColumn(nullable=false)
  28.      */
  29.     private $user;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $field1;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $field2;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $field3;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      */
  45.     private $field4;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $field5;
  50.     /**
  51.      * @ORM\Column(type="string", length=255, nullable=true)
  52.      */
  53.     private $field6;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true)
  56.      */
  57.     private $field7;
  58.     /**
  59.      * @ORM\Column(type="text", nullable=true)
  60.      */
  61.     private $textarea;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $media;
  66.     /**
  67.      * @Vich\UploadableField(mapping="identity_media", fileNameProperty="media")
  68.      * @var File|null
  69.      */
  70.     private $mediaFile;
  71.     /**
  72.      * @ORM\Column(type="datetime")
  73.      */
  74.     private $updatedAt;
  75.     public function __construct()
  76.     {
  77.         $this->updatedAt = new \DateTime();
  78.     }
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getBlogPost(): ?BlogPost
  84.     {
  85.         return $this->blogPost;
  86.     }
  87.     public function setBlogPost(?BlogPost $blogPost): self
  88.     {
  89.         $this->blogPost $blogPost;
  90.         return $this;
  91.     }
  92.     public function getUser(): ?User
  93.     {
  94.         return $this->user;
  95.     }
  96.     public function setUser(?User $user): self
  97.     {
  98.         $this->user $user;
  99.         return $this;
  100.     }
  101.     // Field1 to Field7 getters and setters
  102.     public function getField1(): ?string
  103.     {
  104.         return $this->field1;
  105.     }
  106.     public function setField1(?string $field1): self
  107.     {
  108.         $this->field1 $field1;
  109.         return $this;
  110.     }
  111.     // Repeat similar getters/setters for field2 through field7
  112.     public function getField2(): ?string
  113.     {
  114.         return $this->field2;
  115.     }
  116.     public function setField2(?string $field2): self
  117.     {
  118.         $this->field2 $field2;
  119.         return $this;
  120.     }
  121.     public function getField3(): ?string
  122.     {
  123.         return $this->field3;
  124.     }
  125.     public function setField3(?string $field3): self
  126.     {
  127.         $this->field3 $field3;
  128.         return $this;
  129.     }
  130.     public function getField4(): ?string
  131.     {
  132.         return $this->field4;
  133.     }
  134.     public function setField4(?string $field4): self
  135.     {
  136.         $this->field4 $field4;
  137.         return $this;
  138.     }
  139.     public function getField5(): ?string
  140.     {
  141.         return $this->field5;
  142.     }
  143.     public function setField5(?string $field5): self
  144.     {
  145.         $this->field5 $field5;
  146.         return $this;
  147.     }
  148.     public function getField6(): ?string
  149.     {
  150.         return $this->field6;
  151.     }
  152.     public function setField6(?string $field6): self
  153.     {
  154.         $this->field6 $field6;
  155.         return $this;
  156.     }
  157.     public function getField7(): ?string
  158.     {
  159.         return $this->field7;
  160.     }
  161.     public function setField7(?string $field7): self
  162.     {
  163.         $this->field7 $field7;
  164.         return $this;
  165.     }
  166.     public function getTextarea(): ?string
  167.     {
  168.         return $this->textarea;
  169.     }
  170.     public function setTextarea(?string $textarea): self
  171.     {
  172.         $this->textarea $textarea;
  173.         return $this;
  174.     }
  175.     public function getMedia(): ?string
  176.     {
  177.         return $this->media;
  178.     }
  179.     public function setMedia(?string $media): self
  180.     {
  181.         $this->media $media;
  182.         return $this;
  183.     }
  184.     public function setMediaFile(?File $file null): void
  185.     {
  186.         $this->mediaFile $file;
  187.         if (null !== $file) {
  188.             $this->updatedAt = new \DateTime();
  189.         }
  190.     }
  191.     public function getMediaFile(): ?File
  192.     {
  193.         return $this->mediaFile;
  194.     }
  195.     public function getUpdatedAt(): ?\DateTimeInterface
  196.     {
  197.         return $this->updatedAt;
  198.     }
  199.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  200.     {
  201.         $this->updatedAt $updatedAt;
  202.         return $this;
  203.     }
  204. }