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


PHP enrol_plugin::delete_instance方法代码示例

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


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

示例1: delete_instance

 /**
  * Intercepts the instance deletion call and gives some
  * custom instructions before resuming the parent function
  */
 public function delete_instance($instance)
 {
     global $DB;
     if ($this->get_config('removegroups')) {
         require_once "../group/lib.php";
         $groups = $DB->get_records_sql("SELECT * FROM {groups} WHERE " . $DB->sql_like('idnumber', ':idnumber'), array('idnumber' => "autoenrol|{$instance->id}|%"));
         foreach ($groups as $group) {
             groups_delete_group($group);
         }
     }
     parent::delete_instance($instance);
 }
开发者ID:bystrikondica,项目名称:actnow,代码行数:16,代码来源:lib.php

示例2: delete_instance

 /**
  * Delete plugin specific information.
  *
  * @param stdClass $instance
  * @return void
  */
 public function delete_instance($instance)
 {
     global $DB;
     // Get the tool associated with this instance.
     $tool = $DB->get_record('enrol_lti_tools', array('enrolid' => $instance->id), 'id', MUST_EXIST);
     // Delete any users associated with this tool.
     $DB->delete_records('enrol_lti_users', array('toolid' => $tool->id));
     // Delete the lti tool record.
     $DB->delete_records('enrol_lti_tools', array('id' => $tool->id));
     // Time for the parent to do it's thang, yeow.
     parent::delete_instance($instance);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:18,代码来源:lib.php

示例3: delete_instance

 /**
  * Delete plugin specific information.
  *
  * @param stdClass $instance
  * @return void
  */
 public function delete_instance($instance)
 {
     global $DB;
     // Get the tool associated with this instance.
     $tool = $DB->get_record('enrol_lti_tools', array('enrolid' => $instance->id), 'id', MUST_EXIST);
     // Delete any users associated with this tool.
     $DB->delete_records('enrol_lti_users', array('toolid' => $tool->id));
     // Get tool and consumer mappings.
     $rsmapping = $DB->get_recordset('enrol_lti_tool_consumer_map', array('toolid' => $tool->id));
     // Delete consumers that are linked to this tool and their related data.
     $dataconnector = new data_connector();
     foreach ($rsmapping as $mapping) {
         $consumer = new ToolConsumer(null, $dataconnector);
         $consumer->setRecordId($mapping->consumerid);
         $dataconnector->deleteToolConsumer($consumer);
     }
     $rsmapping->close();
     // Delete mapping records.
     $DB->delete_records('enrol_lti_tool_consumer_map', array('toolid' => $tool->id));
     // Delete the lti tool record.
     $DB->delete_records('enrol_lti_tools', array('id' => $tool->id));
     // Time for the parent to do it's thang, yeow.
     parent::delete_instance($instance);
 }
开发者ID:dg711,项目名称:moodle,代码行数:30,代码来源:lib.php


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