本文整理汇总了PHP中Model\User::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getAll方法的具体用法?PHP User::getAll怎么用?PHP User::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model\User
的用法示例。
在下文中一共展示了User::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
});
$server->register('moveTaskPosition', function ($project_id, $task_id, $column_id, $position) use($task) {
return $task->movePosition($project_id, $task_id, $column_id, $position);
});
/**
* User procedures
*/
$server->register('createUser', function (array $values) use($user) {
list($valid, ) = $user->validateCreation($values);
return $valid && $user->create($values);
});
$server->register('getUser', function ($user_id) use($user) {
return $user->getById($user_id);
});
$server->register('getAllUsers', function () use($user) {
return $user->getAll();
});
$server->register('updateUser', function ($values) use($user) {
list($valid, ) = $user->validateModification($values);
return $valid && $user->update($values);
});
$server->register('removeUser', function ($user_id) use($user) {
return $user->remove($user_id);
});
/**
* Category procedures
*/
$server->register('createCategory', function ($project_id, $name) use($category) {
$values = array('project_id' => $project_id, 'name' => $name);
list($valid, ) = $category->validateCreation($values);
return $valid && $category->create($values);
示例2: testGetAll
public function testGetAll()
{
$u = new User($this->container);
$this->assertEquals(2, $u->create(array('username' => 'you')));
$this->assertEquals(3, $u->create(array('username' => 'me', 'name' => 'Me')));
$users = $u->getAll();
$this->assertCount(3, $users);
$this->assertEquals('admin', $users[0]['username']);
$this->assertEquals('me', $users[1]['username']);
$this->assertEquals('you', $users[2]['username']);
}