Commit 39383582b7994d1dd614fc067742acff6a1ee752
1 parent
7c6df3e9
- no need for bogus delete override.
- add a getByName. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5936 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
7 additions
and
15 deletions
lib/groups/Group.inc
| @@ -136,6 +136,13 @@ class Group extends KTEntity { | @@ -136,6 +136,13 @@ class Group extends KTEntity { | ||
| 136 | return KTEntityUtil::getList2('Group', $sWhereClause, $aOptions); | 136 | return KTEntityUtil::getList2('Group', $sWhereClause, $aOptions); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | + function &getByName($sName) { | ||
| 140 | + $dict = array( | ||
| 141 | + 'name' => $sName, | ||
| 142 | + ); | ||
| 143 | + return KTEntityUtil::getByDict('Group', $dict); | ||
| 144 | + } | ||
| 145 | + | ||
| 139 | /** | 146 | /** |
| 140 | * Returns an array of Users in this group. | 147 | * Returns an array of Users in this group. |
| 141 | */ | 148 | */ |
| @@ -190,21 +197,6 @@ class Group extends KTEntity { | @@ -190,21 +197,6 @@ class Group extends KTEntity { | ||
| 190 | return $aParents; | 197 | return $aParents; |
| 191 | } | 198 | } |
| 192 | 199 | ||
| 193 | - | ||
| 194 | - function delete() { | ||
| 195 | - global $default; | ||
| 196 | - | ||
| 197 | - $sQuery = "DELETE FROM $default->users_groups_table WHERE group_id = ?"; | ||
| 198 | - $aParams = array($this->getId()); | ||
| 199 | - DBUtil::runQuery(array($sQuery, $aParams)); | ||
| 200 | - | ||
| 201 | - $sQuery = "DELETE FROM $default->groups_units_table WHERE group_id = ?"; | ||
| 202 | - $aParams = array($this->getId()); | ||
| 203 | - DBUtil::runQuery(array($sQuery, $aParams)); | ||
| 204 | - | ||
| 205 | - return parent::delete(); | ||
| 206 | - } | ||
| 207 | - | ||
| 208 | // {{{ hasMember | 200 | // {{{ hasMember |
| 209 | function hasMember($oUser) { | 201 | function hasMember($oUser) { |
| 210 | global $default; | 202 | global $default; |