本文整理汇总了PHP中format_base::delete_section方法的典型用法代码示例。如果您正苦于以下问题:PHP format_base::delete_section方法的具体用法?PHP format_base::delete_section怎么用?PHP format_base::delete_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类format_base
的用法示例。
在下文中一共展示了format_base::delete_section方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_section
/**
* Deletes a section
*
* Do not call this function directly, instead call {@link course_delete_section()}
*
* @param int|stdClass|section_info $section
* @param bool $forcedeleteifnotempty if set to false section will not be deleted if it has modules in it.
* @return bool whether section was deleted
*/
public function delete_section($section, $forcedeleteifnotempty = false)
{
global $DB;
if (!is_object($section)) {
$section = $DB->get_record('course_sections', array('course' => $this->get_courseid(), 'section' => $section), 'id,section,sequence');
}
if (parent::delete_section($section, $forcedeleteifnotempty)) {
$coursecontext = context_course::instance($this->courseid);
$this->delete_image($section->id, $coursecontext->id);
return true;
}
return false;
}