-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrganizationTypeModel.php
More file actions
103 lines (93 loc) · 2.41 KB
/
OrganizationTypeModel.php
File metadata and controls
103 lines (93 loc) · 2.41 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
103
<?php // vim:ts=3:sts=3:sw=3:et:
/**
* Organization Type model
*
* PHP Version 5
*
* @category PHP
* @package MindFrame2
* @author Bryan C. Geraghty <bryan@ravensight.org>
* @copyright 2005-2011 Bryan C. Geraghty
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL
* @link https://github.com/archwisp/MindFrame2
*/
/**
* Organization Type model
*
* @category PHP
* @package MindFrame2
* @author Bryan C. Geraghty <bryan@ravensight.org>
* @license http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL
* @link https://github.com/archwisp/MindFrame2
*/
class MindFrame2_OrganizationTypeModel
implements MindFrame2_Dbms_Record_Interface
{
/**
* @var int
*/
private $_organization_type_id;
/**
* @var string
*/
private $_label;
/**
* Initializes the organization_typename property
*
* @param string $organization_type_id OrganizationType ID
* @param string $label OrganizationType name
*
* @throws InvalidArgumentException If organization_type id argument is empty
* @throws InvalidArgumentException If label argument is empty
*/
public function __construct($organization_type_id, $label)
{
MindFrame2_Core::assertArgumentIsNotBlank(
$organization_type_id, 1, 'organization_type_id');
MindFrame2_Core::assertArgumentIsNotBlank($label, 1, 'label');
$this->_organization_type_id = $organization_type_id;
$this->_label = $label;
}
/**
* Returns the organization type's id
*
* @return string
*/
public function getOrganizationTypeId()
{
return $this->_organization_type_id;
}
/**
* Returns the organization type's label
*
* @return string
*/
public function getLabel()
{
return $this->_label;
}
/**
* Wraps getOrganizationTypeId() to conform with
* MindFrame2_Dbms_Record_Interface
*
* @return string
*/
public function getPrimaryKey()
{
return $this->getOrganizationTypeId();
}
/**
* This function is merely a sanity check. If it is called, it throws a
* runtime exception because this model uses constant values.
*
* @param double $value Database identifier
*
* @return void
*
* @throws RuntimeException Because this field is read-only
*/
public function setPrimaryKey($value)
{
throw new RuntimeException('Atempting to change a read-only property');
}
}