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