本文整理汇总了PHP中Model\User::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getList方法的具体用法?PHP User::getList怎么用?PHP User::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model\User
的用法示例。
在下文中一共展示了User::getList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllUsers
/**
* Get allowed and not allowed users for a project
*
* @access public
* @param integer $project_id Project id
* @return array
*/
public function getAllUsers($project_id)
{
$users = array('allowed' => array(), 'not_allowed' => array());
$userModel = new User($this->db, $this->event);
$all_users = $userModel->getList();
$users['allowed'] = $this->getAllowedUsers($project_id);
foreach ($all_users as $user_id => $username) {
if (!isset($users['allowed'][$user_id])) {
$users['not_allowed'][$user_id] = $username;
}
}
return $users;
}
示例2: isset
*/
use Model\User;
$act = isset($_GET['act']) ? $_GET['act'] : '';
if ($act == 'data') {
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$limit = isset($_POST['rows']) ? intval($_POST['rows']) : 10;
if ($page < 1) {
$page = 1;
}
if ($limit < 10) {
$limit = 10;
}
if ($limit > 50) {
$limit = 50;
}
$userData = User::getList($page, $limit);
echo json_encode($userData);
exit(0);
}
?>
<div id="tb">
<a href="#" onclick="add_user();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a>
<a href="#" onclick="edit_user();" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">编辑</a>
<a href="#" onclick="del_user();" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a>
</div>
<div id="module-wrap">
<h2>用户管理</h2>
<table id="user_grid" style="width: 100%; height: auto;"></table>
</div>
<div id="user_dialog"></div>
<script type="text/javascript" src="<?php
示例3: testGetList
public function testGetList()
{
$u = new User($this->container);
$this->assertEquals(2, $u->create(array('username' => 'you')));
$this->assertEquals(3, $u->create(array('username' => 'me', 'name' => 'Me too')));
$users = $u->getList();
$expected = array(1 => 'admin', 3 => 'Me too', 2 => 'you');
$this->assertEquals($expected, $users);
$users = $u->getList(true);
$expected = array(User::EVERYBODY_ID => 'Everybody', 1 => 'admin', 3 => 'Me too', 2 => 'you');
$this->assertEquals($expected, $users);
}