| 1 | <?php |
||
| 14 | class Dragon |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var int $id |
||
| 18 | * @ORM\Id |
||
| 19 | * @ORM\Column(type="integer") |
||
| 20 | * @ORM\GeneratedValue |
||
| 21 | */ |
||
| 22 | private $id; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string $name |
||
| 26 | * @ORM\Column(type="string", length=30, nullable=false) |
||
| 27 | */ |
||
| 28 | private $name; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var DateTime $dob |
||
| 32 | * @ORM\Column(type="date", nullable=true) |
||
| 33 | */ |
||
| 34 | private $dob; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return int |
||
| 38 | */ |
||
| 39 | public function getId(): ?int |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param int $id |
||
| 46 | */ |
||
| 47 | public function setId($id): void |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function getName(): string |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @param string $name |
||
| 62 | */ |
||
| 63 | public function setName(string $name): void |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return DateTime |
||
| 70 | */ |
||
| 71 | public function getDob(): ?DateTime |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @param DateTime $dob |
||
| 78 | */ |
||
| 79 | public function setDob(DateTime $dob): void |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @return array |
||
| 86 | * @param string $dateFormat |
||
| 87 | */ |
||
| 88 | public function toArray(string $dateFormat = 'd/m/Y'): array |
||
| 98 | |||
| 99 | /** |
||
| 100 | * @return string |
||
| 101 | */ |
||
| 102 | public function jsonSerialize(): string |
||
| 106 | |||
| 107 | /** |
||
| 108 | * @return string |
||
| 109 | */ |
||
| 110 | public function __toString(): string |
||
| 114 | } |
||
| 115 |