<?phpnamespace App\Entity;use App\Repository\AttachmentRepository;use Doctrine\ORM\Mapping as ORM;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Vich\UploaderBundle\Form\Type\VichFileType;use Symfony\Component\HttpFoundation\File\File;/** * @ORM\Entity(repositoryClass=AttachmentRepository::class) *//** * @ORM\Entity * @Vich\Uploadable */class Attachment{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $image; /** * @Vich\UploadableField(mapping="gallerie", fileNameProperty="image") * @var File */ private $imageFile2; /** * @ORM\ManyToOne(targetEntity="EvenementAVenir",inversedBy="attachments") */ private $evenement; /** * @ORM\Column(type="integer") */ private $evenement_id; public function getEvenementId(): ?int { return $this->evenement_id; } public function getId(): ?int { return $this->id; } public function getImage(): ?string { return $this->image; } public function setImage(string $image): self { $this->image = $image; return $this; } public function getEvenement(): ?EvenementAVenir { return $this->evenement; } public function setEvenement(?EvenementAVenir $evenement): self { $this->evenement = $evenement; return $this; } public function setImageFile2(File $im = null) { $this->imageFile2 = $im; // VERY IMPORTANT: // It is required that at least one field changes if you are using Doctrine, // otherwise the event listeners won't be called and the file is lost if ($im) { // if 'updatedAt' is not defined in your entity, use another property $this->updatedAt = new \DateTime('now'); } } public function getImageFile2() { return $this->imageFile2; } public function setEvenementId(int $evenement_id): self { $this->evenement_id = $evenement_id; return $this; }}