| 1: | <?php |
| 2: | namespace TIC\AcmeBundle\Entity; |
| 3: | |
| 4: | use TIC\DormBundle\Base\TICEntity as BaseEntity; |
| 5: | use Doctrine\ORM\Mapping as ORM; |
| 6: | use TIC\AcmeBundle\Repository\FooBarRepository as EntityRepo; |
| 7: | |
| 8: | /** |
| 9: | * @ORM\Table(name="tic_acme_foo_bar") |
| 10: | * @ORM\Entity(repositoryClass=EntityRepo::class) |
| 11: | */ |
| 12: | class FooBar extends BaseEntity |
| 13: | { |
| 14: | |
| 15: | // --------------------------------------------------------------------- Properties |
| 16: | |
| 17: | /** |
| 18: | * @ORM\Id |
| 19: | * @ORM\GeneratedValue |
| 20: | * @ORM\Column(type="integer") |
| 21: | */ |
| 22: | private $id; |
| 23: | |
| 24: | |
| 25: | /** |
| 26: | * @ORM\Column(type="string", length=100) |
| 27: | */ |
| 28: | private $name; |
| 29: | |
| 30: | |
| 31: | // --------------------------------------------------------------------- Custom methods |
| 32: | |
| 33: | public function __construct() |
| 34: | { |
| 35: | } |
| 36: | |
| 37: | public function __toString() |
| 38: | { |
| 39: | return $this->name; |
| 40: | } |
| 41: | |
| 42: | |
| 43: | // --------------------------------------------------------------------- Shortcut methods |
| 44: | |
| 45: | |
| 46: | // --------------------------------------------------------------------- Tweaked methods |
| 47: | |
| 48: | |
| 49: | // --------------------------------------------------------------------- Auto-generated |
| 50: | |
| 51: | public function getId(): ?int |
| 52: | { |
| 53: | return $this->id; |
| 54: | } |
| 55: | |
| 56: | public function getName(): ?string |
| 57: | { |
| 58: | return $this->name; |
| 59: | } |
| 60: | |
| 61: | public function setName(string $name): self |
| 62: | { |
| 63: | $this->name = $name; |
| 64: | return $this; |
| 65: | } |
| 66: | |
| 67: | } |