isAdmin() 공개 메소드

Is this user admin?
public isAdmin ( ) : boolean
리턴 boolean
예제 #1
0
/**
 * Unblocks $blocked_user as blocked by $blocking_user.
 *
 * @param ElggUser $blocked_user
 * @param ElggUser $blocking_user
 * @return bool
 */
function block_user(\ElggUser $blocked_user, \ElggUser $blocking_user)
{
    if (!$blocked_user instanceof \ElggUser) {
        return false;
    }
    if ($blocking_user && !$blocking_user instanceof \ElggUser) {
        return false;
    } elseif (!$blocking_user) {
        $blocking_user = elgg_get_logged_in_user_entity();
    }
    // can't block admins
    if ($blocked_user->isAdmin()) {
        return false;
    }
    return add_entity_relationship($blocking_user->getGUID(), 'blocked', $blocked_user->getGUID());
}