-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPhone.php
More file actions
executable file
·102 lines (89 loc) · 1.87 KB
/
Phone.php
File metadata and controls
executable file
·102 lines (89 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
namespace Extcode\Contacts\Domain\Model;
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
/*
* This file is part of the package extcode/contacts.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
class Phone extends AbstractEntity
{
/**
* @var string
*/
protected $type = 'VOICE';
/**
* @var string
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
*/
protected $number = '';
/**
* @var int
*/
protected $sorting = 0;
/**
* @param string $type
* @throws \InvalidArgumentException
*/
public function setType(string $type)
{
$types = [
'PREF',
'WORK',
'HOME',
'VOICE',
'FAX',
'MSG',
'CELL',
'PAGER',
'BBS',
'MODEM',
'CAR',
'ISDN',
'VIDEO'
];
if (!in_array($type, $types)) {
throw new \InvalidArgumentException(
'The type have to be a set of (PREF, WORK, HOME, VOICE, FAX, MSG, CELL, PAGER, BBS, MODEM, CAR, ISDN, VIDEO).',
1373531068
);
}
$this->type = $type;
}
/**
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* @param string $number
*/
public function setNumber(string $number)
{
$this->number = $number;
}
/**
* @return string
*/
public function getNumber()
{
return $this->number;
}
/**
* @return int
*/
public function getSorting()
{
return $this->sorting;
}
/**
* @param int $sorting
*/
public function setSorting(int $sorting)
{
$this->sorting = $sorting;
}
}