本文整理匯總了PHP中Role::getID方法的典型用法代碼示例。如果您正苦於以下問題:PHP Role::getID方法的具體用法?PHP Role::getID怎麽用?PHP Role::getID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Role
的用法示例。
在下文中一共展示了Role::getID方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getRecordSetByRole
/**
* Load groups to roles associations from database using specified role
*
* @param Role $role Role
* @param ARSelectFilter $filter
* @param bool $loadReferencedRecords
*
* @return ARSet
*/
public static function getRecordSetByRole(Role $role, ARSelectFilter $filter, $loadReferencedRecords = false)
{
$filter->mergeCondition(new EqualsCond(new ARFieldHandle(__CLASS__, "roleID"), $role->getID()));
return self::getRecordSet($filter, $loadReferencedRecords = false);
}
示例2: cancelRole
public function cancelRole(Role $role)
{
if (!$role->isExistingRecord()) {
return;
}
$this->canceledRoles[$role->getID()] = $role;
if (isset($this->appliedRoles[$role->getID()])) {
unset($this->appliedRoles[$role->getID()]);
}
}
示例3: deleteRole
public function deleteRole(Role $roleToDelete)
{
// check permissions
if (!PermissionEngine::getInstance()->currentUserCanDo('userCanDeleteRoles')) {
return false;
}
$db = Database::getInstance();
if (!$db->isConnected()) {
return false;
}
$roleID = $db->escapeString($roleToDelete->getID());
$roleName = $db->escapeString($roleToDelete->getName());
$results = $db->removeData('role', 'roleID = ' . $roleID . ' AND roleName = \'' . $roleName . '\'');
if (!$results) {
return false;
}
return true;
}
示例4: assign
public function assign(Role $role)
{
foreach ($this->roles as $assigned) {
if ($assigned->getID() === $role->getID()) {
return;
}
}
$this->roles[] = $role;
}