当前位置: 首页>>代码示例>>PHP>>正文


PHP UserRepository::GetAll方法代码示例

本文整理汇总了PHP中UserRepository::GetAll方法的典型用法代码示例。如果您正苦于以下问题:PHP UserRepository::GetAll方法的具体用法?PHP UserRepository::GetAll怎么用?PHP UserRepository::GetAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserRepository的用法示例。


在下文中一共展示了UserRepository::GetAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ProcessDataRequest

 public function ProcessDataRequest($dataRequest)
 {
     if ($dataRequest == 'permissions') {
         $this->page->SetJsonResponse($this->GetUserResourcePermissions());
     } elseif ($dataRequest == 'groups') {
         $this->page->SetJsonResponse($this->GetUserGroups());
     } elseif ($dataRequest == 'all') {
         $users = $this->userRepository->GetAll();
         $this->page->SetJsonResponse($users);
     }
 }
开发者ID:hugutux,项目名称:booked,代码行数:11,代码来源:ManageUsersPresenter.php

示例2: testGetAllUsersReturnsAllActiveUsers

 public function testGetAllUsersReturnsAllActiveUsers()
 {
     $timezone = 'UTC';
     $language = 'en_us';
     $preferences = 'n1=v1';
     $userRows = array(array(ColumnNames::USER_ID => 1, ColumnNames::FIRST_NAME => "f1", ColumnNames::LAST_NAME => 'l1', ColumnNames::EMAIL => 'e1', ColumnNames::TIMEZONE_NAME => $timezone, ColumnNames::LANGUAGE_CODE => $language), array(ColumnNames::USER_ID => 2, ColumnNames::FIRST_NAME => "f2", ColumnNames::LAST_NAME => 'l2', ColumnNames::EMAIL => 'e2', ColumnNames::TIMEZONE_NAME => $timezone, ColumnNames::LANGUAGE_CODE => $language, ColumnNames::USER_PREFERENCES => $preferences), array(ColumnNames::USER_ID => 3, ColumnNames::FIRST_NAME => "f3", ColumnNames::LAST_NAME => 'l3', ColumnNames::EMAIL => 'e3', ColumnNames::TIMEZONE_NAME => $timezone, ColumnNames::LANGUAGE_CODE => $language));
     $this->db->SetRows($userRows);
     $userRepository = new UserRepository();
     $users = $userRepository->GetAll();
     $user1 = new UserDto(1, "f1", "l1", "e1", $timezone, $language);
     $user2 = new UserDto(2, "f2", "l2", "e2", $timezone, $language, $preferences);
     $user3 = new UserDto(3, "f3", "l3", "e3", $timezone, $language);
     $getAllUsersCommand = new GetAllUsersByStatusCommand(AccountStatus::ACTIVE);
     $this->assertEquals($user1, $users[0]);
     $this->assertEquals($user2, $users[1]);
     $this->assertEquals($user3, $users[2]);
     $this->assertEquals(1, count($this->db->_Commands));
     $this->assertEquals($getAllUsersCommand, $this->db->_Commands[0]);
 }
开发者ID:utn-frm-si,项目名称:booked,代码行数:19,代码来源:UserRepositoryTests.php


注:本文中的UserRepository::GetAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。