本文整理汇总了PHP中AdminHandler::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHandler::getAll方法的具体用法?PHP AdminHandler::getAll怎么用?PHP AdminHandler::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminHandler
的用法示例。
在下文中一共展示了AdminHandler::getAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
});
// Update all subcategories to business
$app->POST('/businesses/{business_id}/subcategory', function (Application $app, Request $request, $business_id) {
if (!authenticate('3', null)) {
return new Response('Unauthorized', 401);
}
$object = array('business_id' => $business_id, 'subcategories' => $request->get('subcategories'));
$handler = new BusinessHandler();
$result = $handler->addAllSubcategories($object);
return new Response($result['message'], $result['status_code']);
});
// Admin routes
// All admin users
$app->GET('/admin', function (Application $app, Request $request) {
$handler = new AdminHandler();
$result = $handler->getAll();
return new Response($result, 200);
});
// Get admin by auth
$app->GET('/adminlogin', function (Application $app, Request $request) {
$admin_id = getAdminIdByLogin();
if ($admin_id == -1) {
return new Response('Unauthorized', 401);
}
$handler = new AdminHandler();
$result = $handler->get($admin_id);
return new Response($result, 200);
});
// Get admin by id
$app->GET('/admin/{admin_id}', function (Application $app, Request $request, $admin_id) {
$handler = new AdminHandler();