本文整理汇总了PHP中UserUtils::getUniqueUsername方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtils::getUniqueUsername方法的具体用法?PHP UserUtils::getUniqueUsername怎么用?PHP UserUtils::getUniqueUsername使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtils
的用法示例。
在下文中一共展示了UserUtils::getUniqueUsername方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: completeUser
/**
* complete the user with the api json
*
* @param User $pUser
* @param Object $pObject
*/
public function completeUser(&$pUser, $lProfileArray)
{
$pUser->setUsername(UserUtils::getUniqueUsername(StringUtils::normalizeUsername($lProfileArray['first-name'] . $lProfileArray['last-name'])));
if (isset($lProfileArray['summary'])) {
$pUser->setDescription(strip_tags($lProfileArray['summary']));
}
$pUser->setActive(true);
$pUser->setAgb(true);
$pUser->setFirstname($lProfileArray['first-name']);
$pUser->setLastname($lProfileArray['last-name']);
if (isset($lProfileArray['location']['country']['code'])) {
$pUser->setCulture($lProfileArray['location']['country']['code']);
}
$pUser->save();
}
示例2: completeUser
/**
* complete the user with the api json
*
* @author Matthias Pfefferle
* @param User $pUser
* @param Object $pObject
*/
public function completeUser(&$pUser, $pObject)
{
$pUser->setUsername(UserUtils::getUniqueUsername(StringUtils::normalizeUsername($pObject->username)));
$pUser->setActive(true);
$pUser->setAgb(true);
$pUser->setFirstname($pObject->firstname);
$pUser->setEmail($pObject->email);
$pUser->setLastname($pObject->lastname);
$pUser->save();
}
示例3: completeUser
/**
* complete the user with the api json
*
* @param User $pUser
* @param Object $pObject
*/
public function completeUser(&$pUser, $pObject)
{
$pUser->setUsername(UserUtils::getUniqueUsername(StringUtils::normalizeUsername($pObject->nickname)));
if (isset($pObject->note) && !$pUser->getDescription()) {
$pUser->setDescription(strip_tags($pObject->note));
}
if (isset($pObject->birthday)) {
$pUser->setBirthdate($pObject->birthday);
}
$pUser->setActive(true);
$pUser->setAgb(true);
$pUser->setCulture("de");
$pUser->save();
}
示例4: completeUser
/**
* complete the user with the api json
*
* @param User $pUser
* @param Object $pObject
*/
public function completeUser(&$pUser, $pObject)
{
$pUser->setUsername(UserUtils::getUniqueUsername(StringUtils::normalizeUsername($pObject["page_name"])));
$pUser->setActive(true);
$pUser->setAgb(true);
$pUser->setFirstname($pObject['first_name']);
$pUser->setFirstname($pObject['last_name']);
$pUser->setEmail($pObject['active_email']);
$pUser->save();
}
示例5: completeUser
/**
* complete the user with the api json
*
* @param User $pUser
* @param Object $pObject
*/
public function completeUser(&$pUser, $pObject)
{
$pUser->setUsername(UserUtils::getUniqueUsername(StringUtils::normalizeUsername($pObject->screen_name)));
$pUser->setDescription(strip_tags($pObject->description));
$pUser->setActive(true);
$pUser->setAgb(true);
// try to split full-name
$lName = MicroformatsTools::splitFN($pObject->name);
if (array_key_exists("firstname", $lName)) {
$pUser->setFirstname($lName['firstname']);
}
if (array_key_exists("lastname", $lName)) {
$pUser->setFirstname($lName['lastname']);
}
$pUser->setCulture(substr($pObject->lang, 0, 2));
$pUser->save();
}