本文整理汇总了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':
示例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;
}
示例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;
}
}