add company logo

This commit is contained in:
Ryan Prather 2025-01-10 14:46:35 +00:00
parent 351cc7c3ac
commit 42fcb7b2f5

View File

@ -5,9 +5,12 @@ namespace App\Entity;
use App\Repository\CompanyRepository; use App\Repository\CompanyRepository;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UuidType; use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\Uuid;
use Vich\UploaderBundle\Entity\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
#[ORM\Entity(repositoryClass: CompanyRepository::class)] #[ORM\Entity(repositoryClass: CompanyRepository::class)]
class Company class Company
@ -42,6 +45,12 @@ class Company
#[ORM\Column(length: 255, nullable: true)] #[ORM\Column(length: 255, nullable: true)]
private ?string $url = null; 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<int, User> * @var Collection<int, User>
*/ */
@ -200,6 +209,30 @@ class Company
return $this; 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 public function __toString(): string
{ {
$url = ($this->url ? "<br/><a href='$this->url' target='_blank'>$this->url</a>" : ''); $url = ($this->url ? "<br/><a href='$this->url' target='_blank'>$this->url</a>" : '');