@@ 9-77 (lines=69) @@ | ||
6 | * |
|
7 | * @author Thiago Paes <[email protected]> |
|
8 | */ |
|
9 | class Document |
|
10 | { |
|
11 | /** |
|
12 | * CPF - for individual |
|
13 | * |
|
14 | * @const int |
|
15 | */ |
|
16 | const CPF = 1; |
|
17 | ||
18 | /** |
|
19 | * CNPJ - for Legal Entity |
|
20 | * |
|
21 | */ |
|
22 | const CNPJ = 2; |
|
23 | ||
24 | /** |
|
25 | * @var string |
|
26 | */ |
|
27 | private $type = self::CPF; |
|
28 | ||
29 | /** |
|
30 | * @var int |
|
31 | */ |
|
32 | private $number; |
|
33 | ||
34 | /** |
|
35 | * Constructor |
|
36 | * |
|
37 | * @param int $type |
|
38 | * @param int $number |
|
39 | */ |
|
40 | public function __construct(int $type = self::CPF, int $number = 0) |
|
41 | { |
|
42 | $this->type = $type; |
|
43 | $this->number = $number; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @return string |
|
48 | */ |
|
49 | public function getType(): int |
|
50 | { |
|
51 | return $this->type; |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * @param string $type |
|
56 | */ |
|
57 | public function setType(int $type) |
|
58 | { |
|
59 | $this->type = $type; |
|
60 | } |
|
61 | ||
62 | /** |
|
63 | * @return mixed |
|
64 | */ |
|
65 | public function getNumber(): int |
|
66 | { |
|
67 | return $this->number; |
|
68 | } |
|
69 | ||
70 | /** |
|
71 | * @param mixed $number |
|
72 | */ |
|
73 | public function setNumber(int $number) |
|
74 | { |
|
75 | $this->number = $number; |
|
76 | } |
|
77 | } |
|
78 |
@@ 9-74 (lines=66) @@ | ||
6 | * |
|
7 | * @author Thiago Paes <[email protected]> |
|
8 | */ |
|
9 | class Phone |
|
10 | { |
|
11 | /** |
|
12 | * @const int |
|
13 | */ |
|
14 | const CELLPHONE = 1; |
|
15 | ||
16 | /** |
|
17 | * @const int |
|
18 | */ |
|
19 | const TELEPHONE = 2; |
|
20 | ||
21 | /** |
|
22 | * @var int |
|
23 | */ |
|
24 | private $number; |
|
25 | ||
26 | /** |
|
27 | * @var int |
|
28 | */ |
|
29 | private $type; |
|
30 | ||
31 | /** |
|
32 | * Constructor |
|
33 | * |
|
34 | * @param int $type |
|
35 | * @param int $number |
|
36 | */ |
|
37 | public function __construct(int $type = self::TELEPHONE, int $number = 0) |
|
38 | { |
|
39 | $this->type = $type; |
|
40 | $this->number = $number; |
|
41 | } |
|
42 | ||
43 | /** |
|
44 | * @return int |
|
45 | */ |
|
46 | public function getNumber(): int |
|
47 | { |
|
48 | return $this->number; |
|
49 | } |
|
50 | ||
51 | /** |
|
52 | * @param int $number |
|
53 | */ |
|
54 | public function setNumber(int $number) |
|
55 | { |
|
56 | $this->number = $number; |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * @return int |
|
61 | */ |
|
62 | public function getType(): int |
|
63 | { |
|
64 | return $this->type; |
|
65 | } |
|
66 | ||
67 | /** |
|
68 | * @param int $type |
|
69 | */ |
|
70 | public function setType(int $type = self::CELLPHONE) |
|
71 | { |
|
72 | $this->type = $type; |
|
73 | } |
|
74 | } |
|
75 |