本文整理汇总了PHP中ilObjRole::getImportId方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjRole::getImportId方法的具体用法?PHP ilObjRole::getImportId怎么用?PHP ilObjRole::getImportId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjRole
的用法示例。
在下文中一共展示了ilObjRole::getImportId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyLocalRoles
/**
* Copy local roles
* This method creates a copy of all local role.
* Note: auto generated roles are excluded
*
* @access public
* @param int source id of object (not role folder)
* @param int target id of object
*
*/
public function copyLocalRoles($a_source_id, $a_target_id)
{
global $rbacreview, $ilLog, $ilObjDataCache;
$real_local = array();
foreach ($rbacreview->getRolesOfRoleFolder($a_source_id, false) as $role_data) {
$title = $ilObjDataCache->lookupTitle($role_data);
if (substr($title, 0, 3) == 'il_') {
continue;
}
$real_local[] = $role_data;
}
if (!count($real_local)) {
return true;
}
// Create role folder
foreach ($real_local as $role) {
include_once "./Services/AccessControl/classes/class.ilObjRole.php";
$orig = new ilObjRole($role);
$orig->read();
$ilLog->write(__METHOD__ . ': Start copying of role ' . $orig->getTitle());
$roleObj = new ilObjRole();
$roleObj->setTitle($orig->getTitle());
$roleObj->setDescription($orig->getDescription());
$roleObj->setImportId($orig->getImportId());
$roleObj->create();
$this->assignRoleToFolder($roleObj->getId(), $a_target_id, "y");
$this->copyRolePermissions($role, $a_source_id, $a_target_id, $roleObj->getId(), true);
$ilLog->write(__METHOD__ . ': Added new local role, id ' . $roleObj->getId());
}
}