Skip to content

Instantly share code, notes, and snippets.



Created Aug 20, 2020
What would you like to do?
Use the EntityIdTrait
namespace App\Entity;
use App\Entity\Traits\EntityIdTrait;
use App\Repository\TestRepository;
use Doctrine\ORM\Mapping as ORM;
* @ORM\Entity(repositoryClass=TestRepository::class)
class Test
use EntityIdTrait;
* @ORM\Column(type="string", length=255, nullable=true)
private $name;
public function getName(): ?string
return $this->name;
public function setName(?string $name): self
$this->name = $name;
return $this;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.