forked from netcommons/NetCommons2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAction.class.php
More file actions
144 lines (135 loc) · 3.56 KB
/
Action.class.php
File metadata and controls
144 lines (135 loc) · 3.56 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* 権限クラス登録用クラス
*
* @package NetCommons Components
* @author Noriko Arai,Ryuji Masukawa
* @copyright 2006-2007 NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @project NetCommons Project, supported by National Institute of Informatics
* @access public
*/
class Authorities_Action
{
/**
* @var DBオブジェクトを保持
*
* @access private
*/
var $_db = null;
/**
* @var DIコンテナを保持
*
* @access private
*/
var $_container = null;
/**
* コンストラクター
*
* @access public
*/
function Authorities_Action() {
$this->_container =& DIContainerFactory::getContainer();
$this->_db =& $this->_container->getComponent("DbObject");
}
/**
* 権限テーブルInsert
*
* @param array $params パラメータ引数
* @return boolean true or false
* @access public
*/
function insAuthority($params=array())
{
$role_authority_id = $this->_db->insertExecute("authorities", $params, true, "role_authority_id");
if($role_authority_id === false) {
return false;
}
return $role_authority_id;
}
/**
* 権限モジュールリンクテーブルInsert
*
* @param array $params パラメータ引数
* @return boolean true or false
* @access public
*/
function insAuthorityModuleLink($params=array())
{
$result = $this->_db->insertExecute("authorities_modules_link", $params, true);
if ($result === false) {
return $result;
}
return true;
}
/**
* 権限テーブルUpdate
*
* @param array $params パラメータ引数
* @param array $where_params Whereパラメータ引数
* @return boolean true or false
* @access public
*/
function updAuthority($params=array(), $where_params=array())
{
$result = $this->_db->updateExecute("authorities", $params, $where_params, true);
if ($result === false) {
return $result;
}
return true;
}
/**
* 権限モジュールリンクテーブルUpdate
*
* @param array $params パラメータ引数
* @param array $where_params Whereパラメータ引数
* @return boolean true or false
* @access public
*/
function updAuthorityModuleLink($params=array(), $where_params=array())
{
$result = $this->_db->updateExecute("authorities_modules_link", $params, $where_params, true);
if ($result === false) {
return $result;
}
return true;
}
/**
* 権限テーブルDelete(role_authority_id)
*
* @param int $authority_id モジュールID
* @return boolean true or false
* @access public
*/
function delAuthorityById($authority_id)
{
$params = array(
"role_authority_id" => $authority_id
);
$result = $this->_db->deleteExecute("authorities", $params);
if ($result === false) {
$this->_db->addError();
return $result;
}
return true;
}
/**
* 権限モジュールリンクテーブルDelete
*
* @param int $authority_id 権限ID
* @param int $module_id モジュールID
* @return boolean true or false
* @access public
*/
function delAuthorityModuleLink($where_params)
{
$result = $this->_db->deleteExecute("authorities_modules_link", $where_params);
if ($result === false) {
$this->_db->addError();
return $result;
}
return true;
}
}
?>