本文整理汇总了PHP中Skill::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Skill::update方法的具体用法?PHP Skill::update怎么用?PHP Skill::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set
protected function set($key, $value)
{
parent::set($key, $value);
switch ($key) {
case 'tier':
$this->_tier = intval($value);
break;
case 'slot':
$this->_slotType = $value;
break;
case 'skills':
foreach ($value as $skillInfo) {
//TODO: This should normally be a "skills" entity set, but it doesn't exist!
$skill = new Skill($this->getSet(), $skillInfo['id']);
unset($skillInfo['id']);
$skill->update($skillInfo, true);
$this->_skills[] = $skill;
}
break;
case 'specialization':
$this->_specializationId = intval($value);
break;
}
}
示例2: unlink
$existsBadgesDirectory = is_dir($badgePath);
if (!$existsBadgesDirectory) {
$existsBadgesDirectory = api_create_protected_dir('badges', api_get_path(SYS_UPLOAD_PATH));
}
if ($existsBadgesDirectory) {
if (!empty($skill['icon'])) {
$iconFileAbsolutePath = $badgePath . $skill['icon'];
if (Security::check_abs_path($iconFileAbsolutePath, $badgePath)) {
unlink($badgePath . $skill['icon']);
}
}
$skillImagePath = sprintf("%s%s.png", $badgePath, $fileName);
$skillImage = new Image($_FILES['image']['tmp_name']);
$skillImage->send_image($skillImagePath, -1, 'png');
$skillThumbPath = sprintf("%s%s-small.png", $badgePath, $fileName);
$skillImageThumb = new Image($skillImagePath);
$skillImageThumb->resize(ICON_SIZE_BIG, ICON_SIZE_BIG);
$skillImageThumb->send_image($skillThumbPath);
$params['icon'] = sprintf("%s.png", $fileName);
} else {
Session::write('errorMessage', get_lang('UplUnableToSaveFile'));
}
}
$objSkill->update($params);
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php');
exit;
}
$interbreadcrumb = array(array('url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', 'name' => get_lang('Administration')), array('url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php', 'name' => get_lang('Badges')), array('url' => '#', 'name' => get_lang('CreateBadge')));
$toolbar = Display::toolbarButton(get_lang('ManageSkills'), api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php', 'list', 'primary', ['title' => get_lang('ManageSkills')]);
echo $toolbar;
echo Container::getTemplating()->render('@template_style/skill/badge_create.html.twig', ['skill' => $skill]);