本文整理匯總了PHP中UserRepository::LoadByPublicId方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserRepository::LoadByPublicId方法的具體用法?PHP UserRepository::LoadByPublicId怎麽用?PHP UserRepository::LoadByPublicId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserRepository
的用法示例。
在下文中一共展示了UserRepository::LoadByPublicId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Registered
private function Registered()
{
$mySession = ServiceLocator::GetServer()->GetUserSession();
$userrepo = new UserRepository();
$user = $userrepo->LoadByPublicId($mySession->PublicId);
$credi = $user->GetAttributeValue(19);
return $credi;
}
示例2: testLoadsUserByPublicId
public function testLoadsUserByPublicId()
{
$userRow = $this->GetUserRow();
$emailPrefRows = $this->GetEmailPrefRows();
$permissionsRows = $this->GetPermissionsRows();
$groupsRows = $this->GetGroupsRows();
$attributeRows = $this->GetAttributeRows();
$ownedGroupRows = $this->GetOwnedGroupRows();
$preferenceRows = $this->GetPreferenceRows();
$this->db->SetRow(0, array($userRow));
$this->db->SetRow(1, $emailPrefRows);
$this->db->SetRow(2, $permissionsRows);
$this->db->SetRow(3, $groupsRows);
$this->db->SetRow(4, $attributeRows);
$this->db->SetRow(5, $ownedGroupRows);
$this->db->SetRow(6, $preferenceRows);
$publicId = uniqid();
$userRepository = new UserRepository();
$user = $userRepository->LoadByPublicId($publicId);
$loadByIdCommand = new GetUserByPublicIdCommand($publicId);
$this->assertEquals(7, count($this->db->_Commands));
$this->assertTrue($this->db->ContainsCommand($loadByIdCommand));
$this->assertNotNull($user);
}