<?php
namespace App\Entity;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\HttpFoundation\File\File;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'attachments')]
#[ORM\Entity]
#[Vich\Uploadable]
class Attachment
{
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
#[Vich\UploadableField(mapping: 'attachments', fileNameProperty: 'image')]
private $imageFile;
#[ORM\Column(type: 'string', length: 250, nullable: true)]
private $image;
#[ORM\Column(name: 'created', type: 'datetime', nullable: true)]
private $created;
#[ORM\ManyToOne(targetEntity: Projects::class, inversedBy: 'attachments')]
private $project;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'attachments')]
private $user;
#[ORM\ManyToOne(targetEntity: Quotes::class, inversedBy: 'attachments')]
private $quote;
public function getId(): ?int
{
return $this->id;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
/**
* @return mixed
*/
public function getImageFile()
{
return $this->imageFile;
}
/**
* @param mixed $imageFile
*/
public function setImageFile(File $imageFile)
{
$this->imageFile = $imageFile;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function __toString()
{
return (string)$this->image;
}
public function getProject(): ?Projects
{
return $this->project;
}
public function setProject(?Projects $project): self
{
$this->project = $project;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getQuote(): ?Quotes
{
return $this->quote;
}
public function setQuote(?Quotes $quote): self
{
$this->quote = $quote;
return $this;
}
}