<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\UniqueConstraint;
use EightMarq\CoreComponent\Entity\BaseEntity;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
use App\Repository\ManufacturerRepository;
/**
* @ORM\Table(name="manufacturers", uniqueConstraints={
* @UniqueConstraint(columns={"name", "deleted_at"})
* })
*
* UniqueEntity(fields={"name"}, errorPath="name", message="error.entity.not_unique"))
*
* @ORM\Entity(repositoryClass=ManufacturerRepository::class)
*
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=true, hardDelete=false)
*/
class Manufacturer extends BaseEntity
{
/**
* @var string | null
*
* @ORM\Column(type="string")
*
* @Assert\NotBlank()
*/
protected $name;
/**
* @return string|null
*/
public function __toString(): string
{
return $this->getName() ?? '';
}
/**
* @return string|null
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string|null $name
*/
public function setName(?string $name): void
{
$this->name = $name;
}
}