本文整理汇总了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;
}