From 42fcb7b2f56c4e5c66c13d101c0dc36594b3eef8 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Fri, 10 Jan 2025 14:46:35 +0000 Subject: [PATCH] add company logo --- src/Entity/Company.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/Entity/Company.php b/src/Entity/Company.php index 7ab19a4..3679531 100644 --- a/src/Entity/Company.php +++ b/src/Entity/Company.php @@ -5,9 +5,12 @@ namespace App\Entity; use App\Repository\CompanyRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; +use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Types\UuidType; use Symfony\Component\Uid\Uuid; +use Vich\UploaderBundle\Entity\File; +use Vich\UploaderBundle\Mapping\Annotation as Vich; #[ORM\Entity(repositoryClass: CompanyRepository::class)] class Company @@ -42,6 +45,12 @@ class Company #[ORM\Column(length: 255, nullable: true)] private ?string $url = null; + #[Vich\UploadableField(mapping: 'profile_image', fileNameProperty: 'imageName', size: 'size', mimeType: 'mimeType', originalName: 'originalName', dimensions: 'dimensions')] + private ?File $imageFile = null; + + #[ORM\Column(type: Types::STRING, length: 255, nullable: true)] + private ?string $companyLogo = null; + /** * @var Collection */ @@ -200,6 +209,30 @@ class Company return $this; } + public function getImageFile(): ?File + { + return $this->imageFile; + } + + public function setImageFile(?File $imageFile): static + { + $this->imageFile = $imageFile; + + return $this; + } + + public function getCompanyLogo(): ?string + { + return $this->companyLogo; + } + + public function setCompanyLogo(?string $companyLogo): static + { + $this->companyLogo = $companyLogo; + + return $this; + } + public function __toString(): string { $url = ($this->url ? "
$this->url" : '');