當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Skill::update方法代碼示例

本文整理匯總了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;
     }
 }
開發者ID:TorbenKoehn,項目名稱:gw2-php,代碼行數:24,代碼來源:SpecializationTrait.php

示例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]);
開發者ID:omaoibrahim,項目名稱:chamilo-lms,代碼行數:31,代碼來源:skill_badge_create.php


注:本文中的Skill::update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。