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


PHP Skill類代碼示例

本文整理匯總了PHP中Skill的典型用法代碼示例。如果您正苦於以下問題:PHP Skill類的具體用法?PHP Skill怎麽用?PHP Skill使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Skill類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addskill

 function addskill($_post)
 {
     $user->id = $this->getuser();
     $profile = new Skill($user->id);
     $result = $profile->create($_post);
     return $result;
 }
開發者ID:joshjim27,項目名稱:jobsglobal,代碼行數:7,代碼來源:employer.php

示例2: listSkills

 public function listSkills()
 {
     $db = new Skill($this->_config);
     $result = $db->getSkills();
     $encodedResult = $this->utf8_converter($result);
     $skills = json_encode($encodedResult);
     echo $skills;
 }
開發者ID:camelcasetechsd,項目名稱:training-careers,代碼行數:8,代碼來源:Main.php

示例3: saveSkill

 public function saveSkill(Skill $skill)
 {
     try {
         $skill->save();
     } catch (Exception $e) {
         throw new DaoException($e->getMessage(), $e->getCode(), $e);
     }
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:8,代碼來源:SkillDao.php

示例4: testAddSkill

 public function testAddSkill()
 {
     $skill = new Skill();
     $skill->setName('Gardening');
     $skill->setDescription('Flower arts');
     $this->skillDao->saveSkill($skill);
     $savedSkill = TestDataService::fetchLastInsertedRecord('Skill', 'id');
     $this->assertTrue($savedSkill instanceof Skill);
     $this->assertEquals('Gardening', $savedSkill->getName());
     $this->assertEquals('Flower arts', $savedSkill->getDescription());
 }
開發者ID:lahirwisada,項目名稱:orangehrm,代碼行數:11,代碼來源:SkillDaoTest.php

示例5: getLevelProgression

 public function getLevelProgression(Skill $s)
 {
     if ($s->hasXp()) {
         $targetXp = self::$table[$s->level + 1];
         $startXp = self::$table[$s->level];
         $distance = $targetXp - $startXp;
         $xpLeft = $targetXp - $s->xp;
         return $distance / $xpLeft;
     }
     trigger_error('User is not ranked in this skill.');
     return 0;
 }
開發者ID:ryanknu,項目名稱:zule-rs,代碼行數:12,代碼來源:XPHelper.php

示例6: getSkillsArray

 public static function getSkillsArray($rows)
 {
     $skills = array();
     if (!empty($rows)) {
         foreach ($rows as $row) {
             $skill = new Skill($row);
             $skill->setSkillId($row['skillId']);
             array_push($skills, $skill);
         }
     }
     return $skills;
 }
開發者ID:mr-augustine,項目名稱:sensor-data-repo,代碼行數:12,代碼來源:SkillsDB.class.php

示例7: test_addData_skillCheck

 function test_addData_skillCheck()
 {
     Initial::addData();
     $skill = Skill::getAll();
     $result = new Skill("Acrobatics", "Balancing and tumbling", 1);
     $this->assertEquals($skill[0], $result);
 }
開發者ID:civilianemail,項目名稱:dnd,代碼行數:7,代碼來源:InitialTest.php

示例8: modify

 /**
  * Modify user
  */
 public function modify($id)
 {
     $user = User::find($id);
     $skills = Skill::findSkillsForUser($id);
     if (!$user) {
         return Redirect::route('members')->with('mError', 'Cet utilisateur est introuvable !');
     }
     return View::make('user.modify', array('user' => $user, 'skills' => $skills));
 }
開發者ID:urashima82,項目名稱:intranet,代碼行數:12,代碼來源:UserController.php

示例9: save_data

/**
 * Save the imported data
 * @param   array   List of users
 * @return  void
 * @uses global variable $inserted_in_course, which returns the list of courses the user was inserted in
 */
function save_data($skills)
{
    if (is_array($skills)) {
        $parents = array();
        foreach ($skills as $index => $skill) {
            if (isset($parents[$skill['parent_id']])) {
                $skill['parent_id'] = $parents[$skill['parent_id']];
            } else {
                $skill['parent_id'] = 1;
            }
            $skill['a'] = 'add';
            $saved_id = $skill['id'];
            $skill['id'] = null;
            $oskill = new Skill();
            $skill_id = $oskill->add($skill);
            $parents[$saved_id] = $skill_id;
        }
    }
}
開發者ID:ilosada,項目名稱:chamilo-lms-icpna,代碼行數:25,代碼來源:skills_import.php

示例10: tearDown

 protected function tearDown()
 {
     CharClass::deleteAll();
     Character::deleteAll();
     Race::deleteAll();
     Skill::deleteAll();
     Stat::deleteAll();
     Description::deleteAll();
     Background::deleteAll();
 }
開發者ID:civilianemail,項目名稱:dnd,代碼行數:10,代碼來源:FinalizeTest.php

示例11: post

 public function post($resourceVals, $data, $userId)
 {
     global $logger, $warnings_payload;
     $userId = 5;
     $skillId = $resourceVals['user-skills'];
     if (isset($skillId)) {
         $warnings_payload[] = 'POST call to /user-skills must not have ' . '/skillID appended i.e. POST /user-skills';
         throw new UnsupportedResourceMethodException();
     }
     if ($data['name'] != null) {
         $nameObj = $this->collapDAO->queryByName($data['name']);
         if (empty($nameObj)) {
             $skillObj = new Skill($data['name']);
             $logger->debug("POSTed Skill Detail: " . $skillObj->toString());
             $this->collapDAO->insert($skillObj);
             $userSkillDetail = $skillObj->toArray();
             if (isset($userSkillDetail['id'])) {
                 $userSkillObj = new UserSkill($userId, $userSkillDetail['id']);
                 $logger->debug("POSTed User Skill Detail: " . $userSkillObj->toString());
                 $this->collapDAO->insertUserSkill($userSkillObj);
                 $userSkillDetail = $userSkillObj->toArray();
             }
         } else {
             $nameSkill = $nameObj[0]->toArray();
             $userSkillObj = new UserSkill($userId, $nameSkill['id']);
             $logger->debug("POSTed User Skill Detail: " . $userSkillObj->toString());
             $this->collapDAO->insertUserSkill($userSkillObj);
             $userSkillDetail = $userSkillObj->toArray();
         }
     } else {
         $userSkillObj = new UserSkill($userId, $data['skill_id']);
         $logger->debug("POSTed User Skill Detail: " . $userSkillObj->toString());
         $this->collapDAO->insertUserSkill($userSkillObj);
         $userSkillDetail = $userSkillObj->toArray();
     }
     if (!isset($userSkillDetail['id'])) {
         return array('code' => '2011');
     }
     $this->userSkillDetail[] = $userSkillDetail;
     return array('code' => '2001', 'data' => array('userSkillDetail' => $this->userSkillDetail));
 }
開發者ID:rajnishp,項目名稱:teamroomV3,代碼行數:41,代碼來源:UserSkillsResource.class.php

示例12: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $opportunity = $this->opportunity->find($id);
     $locations = Location::lists('location_name', 'id');
     $group = Opportunity::find($id);
     $skills = Skill::all();
     $assigned = $group->skills->lists('id');
     if (is_null($opportunity)) {
         return Redirect::route('opportunities.index');
     }
     return View::make('opportunities.edit', compact('opportunity', 'locations', 'group', 'skills', 'assigned'));
 }
開發者ID:jewelhuq,項目名稱:volunteer-app,代碼行數:18,代碼來源:OpportunitiesController.php

示例13: find

 static function find($search_id)
 {
     $found_skill = null;
     $skills = Skill::getAll();
     foreach ($skills as $skill) {
         $skill_id = $skill->getId();
         if ($skill_id == $search_id) {
             $found_skill = $skill;
         }
     }
     return $found_skill;
 }
開發者ID:civilianemail,項目名稱:dnd,代碼行數:12,代碼來源:Skill.php

示例14: train

 /**
  * User goes gym and trains
  * 
  * @return mixed (array/boolean)
  */
 public function train()
 {
     /*
     Session 1-4	100 strength gain per day
     Session 5-14	50 strength gain per day
     Session 15-34	25 strength gain per day
     Session 35-64	10 strength gain per day
     Session 65-124	5 strength gain per day
     Session 125-199	2 strength gain per day
     Session 200+	1 strength gain per day
     */
     $r = Service::getDB()->query("SELECT uid FROM `train_historial` WHERE uid = '" . $this->id . "'");
     $trainedDays = sizeof($r);
     if ($trainedDays < 5) {
         $strengh = 100;
     } elseif ($trainedDays < 15) {
         $strengh = 50;
     } elseif ($trainedDays < 35) {
         $strengh = 25;
     } elseif ($trainedDays < 65) {
         $strengh = 10;
     } elseif ($trainedDays < 125) {
         $strengh = 5;
     } elseif ($trainedDays < 200) {
         $strengh = 2;
     } else {
         $strengh = 1;
     }
     $skill = new Skill();
     $skill->get($this->id);
     $skill->strengh += $strengh;
     if ($skill->save()) {
         Service::getDB()->insert('train_historial', array('uid' => $this->id, 'date' => $this->now()));
         $trainedDays++;
         return array('strengh' => $strengh, 'trainedDays' => $trainedDays);
     } else {
         return false;
     }
 }
開發者ID:AugustoAngeletti,項目名稱:erepublik,代碼行數:44,代碼來源:User.php

示例15: envSkills

 protected function envSkills()
 {
     $skill = new Skill();
     $skill->skill_title = 'PHP';
     $skill->percent = '70';
     $skill->description_title = 'My Skills';
     $skill->description = 'Are Sweet';
     $skill->template_id = 1;
     $skill->save();
     $skill11 = new Skill();
     $skill11->skill_title = 'Javascript';
     $skill11->percent = '50';
     $skill11->description_title = 'My Skills';
     $skill11->description = 'Are Sweet';
     $skill11->template_id = 1;
     $skill11->save();
     $skill12 = new Skill();
     $skill12->skill_title = 'CSS';
     $skill12->percent = '50';
     $skill12->description_title = 'My Skills';
     $skill12->description = 'Are Sweet';
     $skill12->template_id = 1;
     $skill12->save();
     $skill2 = new Skill();
     $skill2->skill_title = 'PHP';
     $skill2->percent = '20';
     $skill2->description_title = 'My Skills';
     $skill2->description = 'Are Sweet';
     $skill2->template_id = 2;
     $skill2->save();
     $skill3 = new Skill();
     $skill3->skill_title = 'PHP';
     $skill3->percent = '20';
     $skill3->description_title = 'My Skills';
     $skill3->description = 'Are Sweet';
     $skill3->template_id = 3;
     $skill3->save();
 }
開發者ID:resumeproductions,項目名稱:Resume-Solutions,代碼行數:38,代碼來源:SkillsTableSeeder.php


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