DataObjects/Groups.php
authoredward <edward@roojs.com>
Wed, 13 Apr 2016 08:04:01 +0000 (16:04 +0800)
committeredward <edward@roojs.com>
Wed, 13 Apr 2016 08:04:01 +0000 (16:04 +0800)
DataObjects/Groups.php

index 3da7871..f697e24 100755 (executable)
@@ -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){
+                
+            }
             
         }