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