当前位置: 首页>>代码示例>>PHP>>正文


PHP Survey::remove方法代码示例

本文整理汇总了PHP中Survey::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Survey::remove方法的具体用法?PHP Survey::remove怎么用?PHP Survey::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Survey的用法示例。


在下文中一共展示了Survey::remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: remove

 public function remove()
 {
     if (!$this->exists()) {
         return false;
     }
     // Remove all of the user's surveys
     foreach ($this->surveys as $surveyID) {
         $survey = new Survey($surveyID);
         $survey->remove();
     }
     // And the container which references them
     Redis::del("User:{$this->id}:surveys");
     // And the username-userid reference
     Redis::set("User:username:{$this->username}");
     parent::remove();
 }
开发者ID:nickyleach,项目名称:OSTSurvey,代码行数:16,代码来源:User.php

示例2: delete

 public function delete($id)
 {
     $survey = new Survey($id);
     if (!$survey->exists()) {
         $this->message = "Survey not found";
         $this->status = 404;
         return;
     }
     if ($survey->ownerID != Session::$user['id']) {
         $this->message = "Unauthorized";
         $this->status = 403;
         return;
     }
     $survey->remove();
     $this->message = "Survey removed";
     $this->status = 204;
 }
开发者ID:nickyleach,项目名称:OSTSurvey,代码行数:17,代码来源:SurveysAPIController.php

示例3: showRemoveSurveyRes

 function showRemoveSurveyRes()
 {
     /* update last page */
     $_SESSION['LASTPAGE'] = 'sysadmin.surveys';
     $displaySysAdmin = new DisplaySysAdmin();
     $suid = getFromSessionParams('suid');
     if ($suid != '') {
         //remove
         $survey = new Survey($suid);
         /* remove sections */
         $sections = $survey->getSections();
         foreach ($sections as $section) {
             $section->remove();
             /* remove variables */
             $variables = $survey->getVariableDescriptives($section->getSeid());
             foreach ($variables as $variable) {
                 $variable->remove();
             }
         }
         /* remove types */
         $types = $survey->getTypes();
         foreach ($types as $type) {
             $type->remove();
         }
         /* remove types */
         $groups = $survey->getGroups();
         foreach ($groups as $group) {
             $group->remove();
         }
         /* remove versions */
         $versions = $survey->getVersions();
         foreach ($versions as $version) {
             $version->remove();
         }
         /* remove survey */
         $survey->remove();
         /* update users */
         $users = new Users();
         $users = $users->getUsers();
         foreach ($users as $u) {
             $u->removeSurvey($suid);
             $u->saveChanges();
         }
         /* return result */
         return $displaySysAdmin->showSurveys($displaySysAdmin->displaySuccess(Language::messageSurveyRemoved($survey->getName())));
     } else {
         return $displaySysAdmin->showSurveys();
     }
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:49,代码来源:sysadmin.php


注:本文中的Survey::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。