collection-crud/src/Entity/Brand.php

44 lines
871 B
PHP
Raw Normal View History

2022-09-29 20:09:31 -04:00
<?php declare(strict_types=1);
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'brand', schema: 'collection')]
#[ORM\Entity]
class Brand
{
2022-09-30 10:49:02 -04:00
use GetSetTrait;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
#[ORM\Column(name: 'id', type: 'integer', nullable: FALSE)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\SequenceGenerator(sequenceName: 'brand_id_seq', allocationSize: 1, initialValue: 1)]
private int $id;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
#[ORM\Column(name: 'name', unique: TRUE, nullable: FALSE)]
private string $name;
2022-09-29 20:09:31 -04:00
2022-09-30 10:49:02 -04:00
public function __toString(): string
{
return $this->name;
}
2022-09-29 20:09:31 -04:00
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;
}
}