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


PHP R::loadAll方法代码示例

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


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

示例1: view

 function view($args)
 {
     $id = array_shift($args);
     $permission = R::load('permission', $id);
     if (!is_numeric($id) && !$permission->getID()) {
         $this->redirect(PACKAGE_URL);
     }
     $allgroups = R::findAll('group');
     foreach ($allgroups as $key => $group) {
         foreach ($permission->sharedGroup as $group_c) {
             if ($group->id == $group_c->id) {
                 $allgroups[$key]->checked = true;
             }
         }
     }
     //		echo $permission->name;exit;
     $view = new G2_TwigView('pages/view');
     $view->permission = $permission;
     $view->allGroups = $allgroups;
     $form = new G2_FormMagic($view->get_render());
     if ($form->is_posted()) {
         $groups = R::loadAll('group', array_keys($form->data()['groups']));
         $permission->sharedGroup = $groups;
         R::store($permission);
         Admin_Alert::add_message("\"{$permission->name}\" permission was updated");
         $this->redirect(PACKAGE_URL);
     }
     echo $form->parse();
 }
开发者ID:g2design,项目名称:g2-modules,代码行数:29,代码来源:admin.php

示例2: select

 public function select($id = null)
 {
     // no id and no other params
     if ($id == null) {
         $items = R::loadAll($this->table, array());
         return $items;
     } else {
         $item = R::load($this->table, $id);
         return $item;
     }
 }
开发者ID:Hannes1,项目名称:WorstFrameworkEver,代码行数:11,代码来源:WFEModel.php

示例3: batchFindByIds

 public static function batchFindByIds($ids)
 {
     return $users = R::loadAll('user', $ids);
 }
开发者ID:xinerd,项目名称:SP_ROI,代码行数:4,代码来源:UserDAOImpl.class.php

示例4: getUserProgress

 static function getUserProgress($id = 0, $complete = 0)
 {
     $data = R::duplicate($_SESSION['user']);
     $out = "<div class='col-sm-12'>\r\n            <div class=\"list-group\"><ul style='padding-left:0;'>";
     $out .= "<li class=\"list-group-item active\">";
     if ($id == 0 && $complete == 0) {
         $out .= "<h4 class=\"list-group-item-heading \"><a role='button' href='?ctrl=cabinet&action=GetCabinet' class='btn btn-info back_button'><span class=\"glyphicon glyphicon-arrow-left\" aria-hidden=\"true\"></span></a>В кабинет </h4>";
     }
     if ($complete == 1) {
         $out .= "<h4 class=\"list-group-item-heading \"><a role='button' href='?ctrl=cabinet&action=GetCabinet' class='btn btn-info back_button'><span class=\"glyphicon glyphicon-arrow-left\" aria-hidden=\"true\"></span></a>В кабинет</h4>";
     }
     if ($id != 0) {
         $out .= "<h4 class=\"list-group-item-heading \"><a role='button' href='?ctrl=cabinet&action=GetUserInformation' class='btn btn-info back_button'><span class=\"glyphicon glyphicon-arrow-left\" aria-hidden=\"true\"></span></a>Вернуться к списку</h4>";
     }
     //?ctrl=cabinet&action=GetUserInformation
     $out .= '</li></ul></div>';
     if ($id == 0) {
         $preWisdom = $data->ownInformation_userList;
         $arrayId = array();
         foreach ($preWisdom as $value) {
             if ($complete == 0) {
                 if (is_null($value->status) && is_null($value->education_id) && is_null($value->lesson_id)) {
                     $arrayId[] = $value->information_id;
                 }
             } else {
                 if (!is_null($value->status) && is_null($value->education_id) && is_null($value->lesson_id)) {
                     $arrayId[] = $value->information_id;
                 }
             }
         }
         $wisdom = R::loadAll('information', $arrayId);
     } else {
         // проверяем записан ли пользователь на данный УМ
         $userInfo = $data->ownInformation_userList;
         foreach ($userInfo as $value) {
             if ($value->information_id == $id) {
                 $wisdom = R::findAll('information', 'where id = ?', [$id]);
             }
         }
     }
     $typeMenu = '6';
     $typeMenu1 = '';
     if ($complete == 0) {
         if ($id === 0) {
             switch ($_SESSION['user']->status) {
                 case "student":
                     $typeMenu = 3;
                     $typeMenu1 = '';
                     break;
                 case "teacher":
                     $typeMenu = 7;
                     $typeMenu1 = 8;
                     break;
                 case "moderator":
                     $typeMenu = 4;
                     //                        $typeMenu1=8;
                     break;
                 case "admin":
                     $typeMenu = 9;
                     $typeMenu1 = 8;
                     break;
             }
         }
     }
     $bigMenu = new menu("SELECT menu_item.*\r\n        FROM  `menu` ,  `menu_item`\r\n        WHERE menu_item.menu_id = ?\r\n       AND menu.menu_id = menu_item.menu_id", [$typeMenu]);
     $bigMenu->ul_tpl = "<ul class=\"nav nav-tabs nav-justified menu_heavy\">";
     if (!empty($wisdom)) {
         foreach ($wisdom as $item) {
             $typeData = wisdom::getType($item);
             if ($typeData[3]->id == 6 && $id != 0) {
                 header('Location:?ctrl=wisdom&action=GetWisdomById&id=' . $id);
             }
             if ($id != 0) {
                 $itemClone = '';
                 if ($typeData[3]->id != 1) {
                     $itemClone = $item;
                 }
                 $modul = self::getInfoEducation($item, $itemClone);
             }
             if ($_SESSION['user']->status !== 'author') {
                 $autor = wisdom::getAuthorName($item->id);
                 $author = "<br><a  href='?ctrl=cabinet&action=UserInfo&id=" . $autor['id'] . "'>" . $autor['login'] . "</a> |\r\n                    <a  href='?ctrl=cabinet&action=UserInfo&id=" . $autor['id'] . "'> " . $autor['surname'] . " " . $autor['name'] . " " . $autor['andername'] . " </a> ";
             }
             $short_description = !empty($item->shortdescription) ? $item->shortdescription : 'Краткое описание отсутствует';
             $out .= "<li class=\"list-group-item\">\r\n                <ol class=\"breadcrumb\">\r\n                    <li><a href=\"?ctrl=wisdom&action=WisdomType&type=" . $typeData[3]->id . "&page=1\" > " . $typeData[3]->name . "</a></li>\r\n                    <li><a href=\"?ctrl=wisdom&action=WisdomType&type=" . $typeData[3]->id . "&subtype=" . $typeData[2]->id . "&page=1\" > " . $typeData[2]->name . "</a></li>\r\n                    <li><a href=\"?ctrl=wisdom&action=WisdomType&type=" . $typeData[3]->id . "&subtype=" . $typeData[2]->id . "&category=" . $typeData[1]->id . "&page=1\" > " . $typeData[1]->name . "</a></li>\r\n                    <li><a href=\"?ctrl=wisdom&action=WisdomType&type=" . $typeData[3]->id . "&subtype=" . $typeData[2]->id . "&category=" . $typeData[1]->id . "&subcategory=" . $typeData[0]->id . "&page=1\" > " . $typeData[0]->name . "</a></li>\r\n\r\n                </ol>\r\n            <h4 class=\"list-group-item-heading\"><a href='?ctrl=wisdom&action=GetWisdomById&id=" . $item->id . "'>" . $item->name . "</a></h4><h5>" . $author . "</h5>\r\n    <p class=\"list-group-item-text\">" . $short_description . "</p>" . $modul;
             if ($id === 0) {
                 $bigMenu->li_tpl = "<li  class=\"dropdown primary\"  role=\"presentation\"><a data-toggle=\"tooltip\" href='%s" . $item->id . "'>%s %s</a>%s</li>";
                 $out .= $bigMenu->render();
             }
             if ($_SESSION['user']->status !== 'student' && !empty($_SESSION['user']->status) && $id != 0) {
                 $out .= "<a role='button' href='?ctrl=teacher&action=AddModul&id=" . $id . "' class='btn btn-info btn-block'>Добавить модуль</a>";
             }
             $out .= "</li>";
             $out .= "</ul></div></div></div>";
         }
     }
     if (empty($wisdom)) {
         $out .= "Вы не подписанны на данный учебный материал";
     }
     return $out;
//.........这里部分代码省略.........
开发者ID:Jluct,项目名称:obuceisea,代码行数:101,代码来源:cabinet.php

示例5: testBatchAliasLoadAll

 /**
  * Test batch alias loadAll.
  * 
  * @return void
  */
 public function testBatchAliasLoadAll()
 {
     $ids = R::storeAll(R::dispense('page', 2));
     $pages = R::loadAll('page', $ids);
     asrt(is_array($pages), true);
     asrt(count($pages), 2);
     asrt($pages[$ids[0]] instanceof RedBean_OODBBean, true);
 }
开发者ID:daviddeutsch,项目名称:redbean-adaptive,代码行数:13,代码来源:Batch.php


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