<?php
namespace App\Entity;
use App\Entity\BlogPost;
use App\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserIdentityFormRepository")
* @Vich\Uploadable
*/
class UserIdentityForm
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=BlogPost::class, inversedBy="userIdentityForms")
* @ORM\JoinColumn(nullable=false)
*/
private $blogPost;
/**
* @ORM\ManyToOne(targetEntity=User::class)
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $field1;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $field2;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $field3;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $field4;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $field5;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $field6;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $field7;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $textarea;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $media;
/**
* @Vich\UploadableField(mapping="identity_media", fileNameProperty="media")
* @var File|null
*/
private $mediaFile;
/**
* @ORM\Column(type="datetime")
*/
private $updatedAt;
public function __construct()
{
$this->updatedAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getBlogPost(): ?BlogPost
{
return $this->blogPost;
}
public function setBlogPost(?BlogPost $blogPost): self
{
$this->blogPost = $blogPost;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
// Field1 to Field7 getters and setters
public function getField1(): ?string
{
return $this->field1;
}
public function setField1(?string $field1): self
{
$this->field1 = $field1;
return $this;
}
// Repeat similar getters/setters for field2 through field7
public function getField2(): ?string
{
return $this->field2;
}
public function setField2(?string $field2): self
{
$this->field2 = $field2;
return $this;
}
public function getField3(): ?string
{
return $this->field3;
}
public function setField3(?string $field3): self
{
$this->field3 = $field3;
return $this;
}
public function getField4(): ?string
{
return $this->field4;
}
public function setField4(?string $field4): self
{
$this->field4 = $field4;
return $this;
}
public function getField5(): ?string
{
return $this->field5;
}
public function setField5(?string $field5): self
{
$this->field5 = $field5;
return $this;
}
public function getField6(): ?string
{
return $this->field6;
}
public function setField6(?string $field6): self
{
$this->field6 = $field6;
return $this;
}
public function getField7(): ?string
{
return $this->field7;
}
public function setField7(?string $field7): self
{
$this->field7 = $field7;
return $this;
}
public function getTextarea(): ?string
{
return $this->textarea;
}
public function setTextarea(?string $textarea): self
{
$this->textarea = $textarea;
return $this;
}
public function getMedia(): ?string
{
return $this->media;
}
public function setMedia(?string $media): self
{
$this->media = $media;
return $this;
}
public function setMediaFile(?File $file = null): void
{
$this->mediaFile = $file;
if (null !== $file) {
$this->updatedAt = new \DateTime();
}
}
public function getMediaFile(): ?File
{
return $this->mediaFile;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
}