Created
August 20, 2020 15:36
-
-
Save parijke/9b3086c088f605d2a1b0bafe1572d6ea to your computer and use it in GitHub Desktop.
Use the EntityIdTrait
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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