本文整理匯總了PHP中MemberModel::findById方法的典型用法代碼示例。如果您正苦於以下問題:PHP MemberModel::findById方法的具體用法?PHP MemberModel::findById怎麽用?PHP MemberModel::findById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MemberModel
的用法示例。
在下文中一共展示了MemberModel::findById方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: saveDefaultUserName
public function saveDefaultUserName($varValue, DataContainer $dc)
{
$member = \MemberModel::findById($dc->id);
$member->username = $varValue;
$member->save();
return $varValue;
}
示例2: compile
protected function compile()
{
if ($this->check_news && FE_USER_LOGGED_IN) {
$this->Import('FrontendUser', 'Member');
$objMember = \MemberModel::findById($this->Member->id);
$arrArchives = deserialize($this->news_archives);
if (is_array($arrArchives)) {
$objNews = $this->Database->prepare("SELECT * FROM tl_news WHERE pid IN(" . implode(",", $arrArchives) . ") && tstamp > ? && published='1'")->execute($objMember->lastLogin);
if (!$objNews->count()) {
$objPage = \PageModel::findById($this->jumpTo);
\Controller::redirect(\Controller::generateFrontendUrl($objPage->row(), ''));
}
}
}
if (!FE_USER_LOGGED_IN && $this->redirecter_guests or FE_USER_LOGGED_IN && $this->redirecter_protected) {
$objPage = \PageModel::findById($this->jumpTo);
$this->redirect($this->generateFrontendUrl($objPage->row(), ''));
}
}
示例3: activateAccount
/**
* @param Database_Result $objUser
*/
public function activateAccount($memberModel, $registrationModule)
{
// Auto AutoKey
if (\Config::get('login_link_autoKey') == 'onActivateAccount') {
$memberModel = \MemberModel::findById($memberModel->id);
if (!$memberModel->loginLink) {
$memberModel->loginLink = self::generateLoginKey();
}
// Auto ExpireTime
if (\Config::get('login_link_useDefaultExpireTime') && \Config::get('login_link_defaultExpireTime')) {
$intExpireTime = time() + \Config::get('login_link_defaultExpireTime');
$memberModel->loginLinkExpire = $intExpireTime;
}
$memberModel->save();
}
}