Created
May 12, 2020 18:59
-
-
Save anvodev/b2cd267f44562bcc2e5e94954c651985 to your computer and use it in GitHub Desktop.
Customer Entity with default autogenerate ID
This file contains hidden or 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\Repository\CustomerRepository; | |
| use Doctrine\ORM\Mapping as ORM; | |
| /** | |
| * @ORM\Entity(repositoryClass=CustomerRepository::class) | |
| */ | |
| class Customer | |
| { | |
| /** | |
| * @ORM\Id() | |
| * @ORM\GeneratedValue() | |
| * @ORM\Column(type="integer") | |
| */ | |
| private $id; | |
| /** | |
| * @ORM\Column(type="string", length=255) | |
| */ | |
| private $name; | |
| public function getId(): ?int | |
| { | |
| return $this->id; | |
| } | |
| 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