當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserRepository::GetList方法代碼示例

本文整理匯總了PHP中UserRepository::GetList方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserRepository::GetList方法的具體用法?PHP UserRepository::GetList怎麽用?PHP UserRepository::GetList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserRepository的用法示例。


在下文中一共展示了UserRepository::GetList方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: PageLoad

 public function PageLoad()
 {
     if ($this->page->GetUserId() != null) {
         $userList = $this->userRepository->GetList(1, 1, null, null, new SqlFilterEquals(ColumnNames::USER_ID, $this->page->GetUserId()));
     } else {
         $userList = $this->userRepository->GetList($this->page->GetPageNumber(), $this->page->GetPageSize(), null, null, null, $this->page->GetFilterStatusId());
     }
     $this->page->BindUsers($userList->Results());
     $this->page->BindPageInfo($userList->PageInfo());
     $groups = $this->groupViewRepository->GetList();
     $this->page->BindGroups($groups->Results());
     $resources = array();
     $user = $this->userRepository->LoadById(ServiceLocator::GetServer()->GetUserSession()->UserId);
     $allResources = $this->resourceRepository->GetResourceList();
     foreach ($allResources as $resource) {
         if ($user->IsResourceAdminFor($resource)) {
             $resources[] = $resource;
         }
     }
     $this->page->BindResources($resources);
     $userIds = array();
     /** @var $user UserItemView */
     foreach ($userList->Results() as $user) {
         $userIds[] = $user->Id;
     }
     $attributeList = $this->attributeService->GetAttributes(CustomAttributeCategory::USER, $userIds);
     $this->page->BindAttributeList($attributeList);
 }
開發者ID:hugutux,項目名稱:booked,代碼行數:28,代碼來源:ManageUsersPresenter.php

示例2: GetUsers

 /**
  * @param $term string
  * @return array|AutocompleteUser[]
  */
 private function GetUsers($term)
 {
     if ($term == 'group') {
         return $this->GetGroupUsers($this->GetQuerystring(QueryStringKeys::GROUP_ID));
     }
     $filter = new SqlFilterLike(ColumnNames::FIRST_NAME, $term);
     $filter->_Or(new SqlFilterLike(ColumnNames::LAST_NAME, $term));
     $filter->_Or(new SqlFilterLike(ColumnNames::EMAIL, $term));
     $users = array();
     $r = new UserRepository();
     $results = $r->GetList(1, PageInfo::All, null, null, $filter)->Results();
     /** @var $result UserItemView */
     foreach ($results as $result) {
         $users[] = new AutocompleteUser($result->Id, $result->First, $result->Last, $result->Email, $result->Username);
     }
     return $users;
 }
開發者ID:Trideon,項目名稱:gigolo,代碼行數:21,代碼來源:AutoCompletePage.php

示例3: PageLoad

 public function PageLoad()
 {
     if ($this->page->GetUserId() != null) {
         $userList = $this->userRepository->GetList(1, 1, null, null, new SqlFilterEquals(ColumnNames::USER_ID, $this->page->GetUserId()));
     } else {
         $userList = $this->userRepository->GetList($this->page->GetPageNumber(), $this->page->GetPageSize(), null, null, null, $this->page->GetFilterStatusId());
     }
     $this->page->BindUsers($userList->Results());
     $this->page->BindPageInfo($userList->PageInfo());
     $groups = $this->groupViewRepository->GetList();
     $this->page->BindGroups($groups->Results());
     $user = $this->userRepository->LoadById(ServiceLocator::GetServer()->GetUserSession()->UserId);
     $resources = $this->GetResourcesThatCurrentUserCanAdminister($user);
     $this->page->BindResources($resources);
     $attributeList = $this->attributeService->GetByCategory(CustomAttributeCategory::USER);
     $this->page->BindAttributeList($attributeList);
 }
開發者ID:utn-frm-si,項目名稱:booked,代碼行數:17,代碼來源:ManageUsersPresenter.php

示例4: testCanGetPageableListOfUsers

 public function testCanGetPageableListOfUsers()
 {
     $page = 3;
     $pageSize = 5;
     $count = 51;
     $totalPages = 11;
     $offset = 10;
     $countRow = array('total' => $count);
     $row1 = $this->GetUserRow(1, 'first', 'last', 'email', 'un1', '2011-01-01', 'utc', AccountStatus::ACTIVE, null, 'pref1=val1,pref2=val2');
     $row2 = $this->GetUserRow(2, 'first', 'last', 'email', null, '2010-01-01');
     $userRows = array($row1, $row2);
     $this->db->SetRow(0, array($countRow));
     $this->db->SetRow(1, $userRows);
     $userRepo = new UserRepository();
     $pageable = $userRepo->GetList($page, $pageSize);
     $this->assertEquals($count, $pageable->PageInfo()->Total);
     $this->assertEquals($totalPages, $pageable->PageInfo()->TotalPages);
     $this->assertEquals($pageSize, $pageable->PageInfo()->PageSize);
     $this->assertEquals($page, $pageable->PageInfo()->CurrentPage);
     $results = $pageable->Results();
     $this->assertEquals(UserItemView::Create($row1), $results[0]);
     $this->assertEquals(UserItemView::Create($row2), $results[1]);
     $this->assertEquals($offset, $this->db->_Offset);
     $this->assertEquals($pageSize, $this->db->_Limit);
 }
開發者ID:utn-frm-si,項目名稱:booked,代碼行數:25,代碼來源:UserRepositoryTests.php


注:本文中的UserRepository::GetList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。