projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
af65d78
)
DataObjects/Groups.php
author
edward
<edward@roojs.com>
Wed, 13 Apr 2016 08:04:01 +0000
(16:04 +0800)
committer
edward
<edward@roojs.com>
Wed, 13 Apr 2016 08:04:01 +0000
(16:04 +0800)
DataObjects/Groups.php
patch
|
blob
|
history
diff --git
a/DataObjects/Groups.php
b/DataObjects/Groups.php
index
3da7871
..
f697e24
100755
(executable)
--- a/
DataObjects/Groups.php
+++ b/
DataObjects/Groups.php
@@
-165,14
+165,22
@@
class Pman_Core_DataObjects_Groups extends DB_DataObject
function initDatabase($roo, $data)
{
$this->initGroups();
+
foreach($data as $gi) {
$g = DB_DataObject::factory('Groups');
$g->setFrom($gi);
- if ($g->count()) {
+
+ if(!$g->find(true)){
+ $g->insert();
+ }
+
+ if(count($g->members()) || empty($gi['members'])){
continue;
}
- $g->insert();
+ foreach ($gi['members'] as $m){
+
+ }
}