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


PHP Roles::load方法代码示例

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


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

示例1: isset

     $filter = isset($_REQUEST['textFilter']) ? $_REQUEST['textFilter'] : '';
     global $RBAC;
     $Criterias = $RBAC->getAllRolesFilter($start, $limit, $filter);
     $rs = RolesPeer::DoSelectRs($Criterias['LIST']);
     $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $content = new Content();
     $rNames = $content->getAllContentsByRole();
     $aUsers = $RBAC->getAllUsersByRole();
     $aRows = array();
     while ($rs->next()) {
         $aRows[] = $rs->getRow();
         $index = sizeof($aRows) - 1;
         $roleUid = $aRows[$index]['ROL_UID'];
         if (!isset($rNames[$roleUid])) {
             $rol = new Roles();
             $row = $rol->load($roleUid);
             $rolname = $row['ROL_NAME'];
         } else {
             $rolname = $rNames[$roleUid];
         }
         $aRows[$index]['ROL_NAME'] = $rolname;
         $aRows[$index]['TOTAL_USERS'] = isset($aUsers[$roleUid]) ? $aUsers[$roleUid] : 0;
     }
     $oData = RolesPeer::doSelectRS($Criterias['COUNTER']);
     $oData->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oData->next();
     $row = $oData->getRow();
     $total_roles = $row['CNT'];
     echo '{roles: ' . G::json_encode($aRows) . ', total_roles: ' . $total_roles . '}';
     break;
 case 'updatePageSize':
开发者ID:bqevin,项目名称:processmaker,代码行数:31,代码来源:roles_Ajax.php

示例2: getAllRoles

 function getAllRoles($systemCode = 'PROCESSMAKER')
 {
     $c = $this->listAllRoles($systemCode);
     $rs = RolesPeer::DoSelectRs($c);
     $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $aRows = array();
     while ($rs->next()) {
         $row = $rs->getRow();
         $o = new Roles();
         $o->load($row['ROL_UID']);
         $row['ROL_NAME'] = $o->getRolName();
         if ($row['ROL_NAME'] == '') {
             $row['ROL_NAME'] = $o->getRolCode();
         }
         $aRows[] = $row;
     }
     return $aRows;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:18,代码来源:Roles.php

示例3: getRole

 /**
  * Get data of a Role
  *
  * @param string $roleUid       Unique id of Role
  * @param bool   $flagGetRecord Value that set the getting
  *
  * return array Return an array with data of a Role
  */
 public function getRole($roleUid, $flagGetRecord = false)
 {
     try {
         //Verify data
         $this->throwExceptionIfNotExistsRole($roleUid, $this->arrayFieldNameForException["roleUid"]);
         //Set variables
         if (!$flagGetRecord) {
             $content = new \Content();
             $role = new \Roles();
             $arrayContentByRole = $content->getAllContentsByRole();
         }
         //Get data
         //SQL
         $criteria = $this->getRoleCriteria();
         if (!$flagGetRecord) {
             $criteria->addAsColumn("ROL_TOTAL_USERS", "(SELECT COUNT(" . \UsersRolesPeer::ROL_UID . ") FROM " . \UsersRolesPeer::TABLE_NAME . " WHERE " . \UsersRolesPeer::ROL_UID . " = " . \RolesPeer::ROL_UID . ")");
         }
         $criteria->add(\RolesPeer::ROL_UID, $roleUid, \Criteria::EQUAL);
         $rsCriteria = \RolesPeer::doSelectRS($criteria);
         $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
         $rsCriteria->next();
         $row = $rsCriteria->getRow();
         if (!$flagGetRecord) {
             if (isset($arrayContentByRole[$roleUid])) {
                 $roleName = $arrayContentByRole[$roleUid];
             } else {
                 $rowAux = $role->load($roleUid);
                 $roleName = $rowAux["ROL_NAME"];
             }
             $row["ROL_NAME"] = $roleName;
         }
         //Return
         return !$flagGetRecord ? $this->getRoleDataFromRecord($row) : $row;
     } catch (\Exception $e) {
         throw $e;
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:45,代码来源:Role.php


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