コード例 #1
0
ファイル: globals.php プロジェクト: IASA-GR/appdb-core
 private static function addVAppliance($researcher, $vo, $vappversion)
 {
     if ($vappversion->isExpired()) {
         return "Virtual appliance version is expired";
     }
     $imagelists = $vappversion->getVappLists();
     if (count($imagelists) === 0) {
         return "No vappliance image instances to include in vo image list";
     }
     $voimglist = self::getDraftVoImageList($researcher, $vo, true);
     if ($voimglist === null) {
         return "Could not retrieve draft VO wide image list";
     }
     //Clearing draft from current vappliance images lists
     $result = self::clearDraftImages($researcher, $vo, $vappversion);
     if ($result !== true) {
         if ($result === false) {
             return "Could not clear draft vo image list for given virtual appliance";
         } else {
             return $result;
         }
     }
     foreach ($imagelists as $imglst) {
         $voimglstimg = new Default_Model_VOWideImageListImage();
         $voimglstimg->vowideImageListID = $voimglist->id;
         $voimglstimg->vapplistid = $imglst->id;
         $voimglstimg->state = "draft";
         $voimglstimg->save();
     }
     return true;
 }