1 | <?php |
2 | |
3 | require_once __DIR__ . "/../../lib/php/validaNombre.php"; |
4 | |
5 | class Pasatiempo |
6 | { |
7 | |
8 | public int $id; |
9 | public string $nombre; |
10 | |
11 | public function __construct(string $nombre = "", int $id = 0) |
12 | { |
13 | $this->id = $id; |
14 | $this->nombre = $nombre; |
15 | } |
16 | |
17 | public function valida() |
18 | { |
19 | validaNombre($this->nombre); |
20 | } |
21 | } |
22 |