本文整理匯總了PHP中UserData::setSkillAreas方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserData::setSkillAreas方法的具體用法?PHP UserData::setSkillAreas怎麽用?PHP UserData::setSkillAreas使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserData
的用法示例。
在下文中一共展示了UserData::setSkillAreas方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getUserDataArray
public static function getUserDataArray($rowSets)
{
$usersData = array();
if (!empty($rowSets)) {
foreach ($rowSets as $userDataRow) {
$userData = new UserData($userDataRow);
$userDataId = $userDataRow['userDataId'];
// The UserData constructor does not set the userDataId for
// a new UserData object; the UserData table takes care of that
// during insertion. Here we manually set the userDataId to
// complete the UserData object.
$userData->setUserDataId($userDataId);
// We should also get the user's associated skills
$skillAssocs = SkillAssocsDB::getSkillAssocsBy('userDataId', $userDataId);
$skill_areas = array();
foreach ($skillAssocs as $skillAssoc) {
$skillId = $skillAssoc->getSkillId();
// skillIds start from 1, however array-indexing
// starts at 0; so we use an offset of -1 when retrieving
// values from $SKILL_AREAS
$skill_name = Skill::$SKILL_AREAS[$skillId - 1];
array_push($skill_areas, $skill_name);
}
$userData->setSkillAreas($skill_areas);
array_push($usersData, $userData);
}
}
return $usersData;
}