本文整理汇总了PHP中PFUser::toRow方法的典型用法代码示例。如果您正苦于以下问题:PHP PFUser::toRow方法的具体用法?PHP PFUser::toRow怎么用?PHP PFUser::toRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PFUser
的用法示例。
在下文中一共展示了PFUser::toRow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Project $project, PFUser $pfuser, $suffix)
{
parent::__construct($pfuser->toRow());
$this->setStatus(PFUser::STATUS_RESTRICTED);
$this->setRealName(self::REAL_NAME);
$this->setUserName(self::NAME_PREFIX . $project->getUnixName() . $suffix);
$this->project = $project;
}
示例2: updateDb
/**
* Update db entry of 'user' table with values in object
* @param PFUser $user
*/
public function updateDb(PFUser $user)
{
if (!$user->isAnonymous()) {
$old_user = $this->getUserByIdWithoutCache($user->getId());
$userRow = $user->toRow();
if ($user->getPassword() != '') {
$password_handler = PasswordHandlerFactory::getPasswordHandler();
if (!$password_handler->verifyHashPassword($user->getPassword(), $user->getUserPw()) || $password_handler->isPasswordNeedRehash($user->getUserPw())) {
// Update password
$userRow['clear_password'] = $user->getPassword();
}
}
if ($user->getLegacyUserPw() !== '' && !ForgeConfig::get('sys_keep_md5_hashed_password')) {
$userRow['user_pw'] = '';
}
$result = $this->getDao()->updateByRow($userRow);
if ($result) {
if ($user->isSuspended() || $user->isDeleted()) {
$this->getDao()->deleteAllUserSessions($user->getId());
}
$this->_getEventManager()->processEvent(Event::USER_MANAGER_UPDATE_DB, array('old_user' => $old_user, 'new_user' => &$user));
}
return $result;
}
return false;
}
示例3: __construct
public function __construct(PFUser $user)
{
parent::__construct($user->toRow());
}