本文整理匯總了PHP中core_competency\api::read_framework方法的典型用法代碼示例。如果您正苦於以下問題:PHP api::read_framework方法的具體用法?PHP api::read_framework怎麽用?PHP api::read_framework使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類core_competency\api
的用法示例。
在下文中一共展示了api::read_framework方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor
* @param int $frameworkid The framework id
*/
public function __construct($frameworkid)
{
$this->framework = api::read_framework($frameworkid);
}
示例2: redirect
echo $output->header();
echo $output->heading($title);
$form = new \tool_lpmigrate\form\migrate_framework($context);
if ($form->is_cancelled()) {
redirect($url);
} else {
if ($data = $form->get_data()) {
// Map competencies from both framework.
$mapper = new \tool_lpmigrate\framework_mapper($data->from, $data->to);
$mapper->automap();
$progress = new \core\progress\display();
$progress->set_display_names(true);
$processor = new \tool_lpmigrate\framework_processor($mapper, $progress);
if (!empty($data->allowedcourses)) {
$processor->set_allowedcourses($data->allowedcourses);
}
if (!empty($data->disallowedcourses)) {
$processor->set_disallowedcourses($data->disallowedcourses);
}
$processor->set_course_start_date_from($data->coursestartdate);
$processor->proceed();
$unmappedfrom = $mapper->get_unmapped_objects_from();
$unmappedto = $mapper->get_unmapped_objects_to();
$renderable = new \tool_lpmigrate\output\migrate_framework_results($context, $processor, \core_competency\api::read_framework($data->from), \core_competency\api::read_framework($data->to), $unmappedfrom, $unmappedto);
echo $output->render($renderable);
} else {
echo html_writer::tag('p', get_string('explanation', 'tool_lpmigrate'));
$form->display();
}
}
echo $output->footer();
示例3: count_competencies
/**
* Count the existing competency frameworks.
*
* @param string $filters Filters to use.
* @return boolean
*/
public static function count_competencies($filters)
{
$params = self::validate_parameters(self::count_competencies_parameters(), array('filters' => $filters));
$safefilters = array();
$validcolumns = array('id', 'shortname', 'description', 'sortorder', 'idnumber', 'parentid', 'competencyframeworkid');
foreach ($params['filters'] as $filter) {
if (!in_array($filter['column'], $validcolumns)) {
throw new invalid_parameter_exception('Filter column was invalid');
}
$safefilters[$filter['column']] = $filter['value'];
}
$context = null;
if (isset($safefilters['competencyframeworkid'])) {
$framework = api::read_framework($safefilters['competencyframeworkid']);
$context = $framework->get_context();
} else {
$context = context_system::instance();
}
self::validate_context($context);
return api::count_competencies($safefilters);
}
示例4: optional_param
require_once __DIR__ . '/../../../config.php';
require_once $CFG->libdir . '/adminlib.php';
$id = optional_param('id', 0, PARAM_INT);
$competencyframeworkid = optional_param('competencyframeworkid', 0, PARAM_INT);
$pagecontextid = required_param('pagecontextid', PARAM_INT);
// Reference to the context we came from.
$parentid = optional_param('parentid', 0, PARAM_INT);
require_login();
\core_competency\api::require_enabled();
if (empty($competencyframeworkid) && empty($id)) {
throw new coding_exception('Competencyframeworkid param is required');
}
// Get competency framework.
$competencyframework = null;
if (!empty($competencyframeworkid)) {
$competencyframework = \core_competency\api::read_framework($competencyframeworkid);
}
// Get competency.
$competency = null;
if (!empty($id)) {
$competency = \core_competency\api::read_competency($id);
if (empty($competencyframework)) {
$competencyframework = $competency->get_framework();
}
}
// Get parent competency, if any.
$parent = null;
if ($competency) {
$parent = $competency->get_parent();
} else {
if ($parentid) {
示例5: data_for_competency_summary
/**
* Loads the data required to render the competency_page template.
*
* @param int $competencyid Competency id.
* @param boolean $includerelated Include or not related competencies.
* @param boolean $includecourses Include or not competency courses.
*
* @return \stdClass
*/
public static function data_for_competency_summary($competencyid, $includerelated = false, $includecourses = false)
{
global $PAGE;
$params = self::validate_parameters(self::data_for_competency_summary_parameters(), array('competencyid' => $competencyid, 'includerelated' => $includerelated, 'includecourses' => $includecourses));
$competency = api::read_competency($params['competencyid']);
$framework = api::read_framework($competency->get_competencyframeworkid());
self::validate_context($framework->get_context());
$renderable = new output\competency_summary($competency, $framework, $params['includerelated'], $params['includecourses']);
$renderer = $PAGE->get_renderer('tool_lp');
$data = $renderable->export_for_template($renderer);
return $data;
}