<?php
namespace App\Entity\Garages;
use App\Entity\AbstractBase;
use App\Entity\Interfaces\Image2Interface;
use App\Entity\Interfaces\Image3Interface;
use App\Entity\Interfaces\Image4Interface;
use App\Entity\Interfaces\ImageInterface;
use App\Entity\MiniAbstractBase;
use App\Entity\Traits\DescriptionTrait;
use App\Entity\Traits\HasImage2Trait;
use App\Entity\Traits\HasImage3Trait;
use App\Entity\Traits\HasImage4Trait;
use App\Entity\Traits\HasImageTrait;
use App\Repository\Garages\GarageAboutUsRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Table(name="vulco_garage_about_us")
*
* @ORM\Entity(repositoryClass=GarageAboutUsRepository::class)
*
* @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
*
* @Vich\Uploadable
*/
class GarageAboutUs extends AbstractBase implements ImageInterface, Image2Interface, Image3Interface, Image4Interface
{
use DescriptionTrait;
use HasImageTrait;
use HasImage2Trait;
use HasImage3Trait;
use HasImage4Trait;
/**
* @ORM\Column(type="text", length=10000, nullable=true)
*/
private ?string $description = null;
/**
* @Vich\UploadableField(mapping="garage_about_us", fileNameProperty="imageName")
*/
private ?File $image = null;
/**
* @Vich\UploadableField(mapping="garage_about_us", fileNameProperty="image2Name")
*/
private ?File $image2 = null;
/**
* @Vich\UploadableField(mapping="garage_about_us", fileNameProperty="image3Name")
*/
private ?File $image3 = null;
/**
* @Vich\UploadableField(mapping="garage_about_us", fileNameProperty="image4Name")
*/
private ?File $image4 = null;
public function hasAnyImage(): bool
{
if (!empty($this->getImageName()) ||
!empty($this->getImage2Name()) ||
!empty($this->getImage3Name()) ||
!empty($this->getImage4Name())
) {
return true;
}
return false;
}
public function __toString(): string
{
return $this->id ? $this->getDescription() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
}
}