Methods Available from the Drupal User Class

Classy Users!
Classy Users!

Continuing on my theme of dumping the methods available form classes within Drupal 8, here are some user class methods I'll probably be looking up a thousand times:

$x =  \Drupal\user\Entity\User::load(1);
print_r(get_class_methods($x));
 
    [0] => isNew
    [1] => preSave
    [2] => postSave
    [3] => postDelete
    [4] => getRoles
    [5] => hasRole
    [6] => addRole
    [7] => removeRole
    [8] => hasPermission
    [9] => getPassword
    [10] => setPassword
    [11] => getEmail
    [12] => setEmail
    [13] => getCreatedTime
    [14] => getLastAccessedTime
    [15] => setLastAccessTime
    [16] => getLastLoginTime
    [17] => setLastLoginTime
    [18] => isActive
    [19] => isBlocked
    [20] => activate
    [21] => block
    [22] => getTimeZone
    [23] => getPreferredLangcode
    [24] => getPreferredAdminLangcode
    [25] => getInitialEmail
    [26] => isAuthenticated
    [27] => isAnonymous
    [28] => getUsername
    [29] => getAccountName
    [30] => getDisplayName
    [31] => setUsername
    [32] => setExistingPassword
    [33] => checkExistingPassword
    [34] => getAnonymousUser
    [35] => baseFieldDefinitions
    [36] => getAllowedTimezones
    [37] => getAllowedConfigurableLanguageCodes
    [38] => __construct
    [39] => postCreate
    [40] => setNewRevision
    [41] => isNewRevision
    [42] => isDefaultRevision
    [43] => isRevisionTranslationAffected
    [44] => setRevisionTranslationAffected
    [45] => isDefaultTranslation
    [46] => getRevisionId
    [47] => isTranslatable
    [48] => preSaveRevision
    [49] => validate
    [50] => isValidationRequired
    [51] => setValidationRequired
    [52] => __sleep
    [53] => id
    [54] => bundle
    [55] => uuid
    [56] => hasField
    [57] => get
    [58] => set
    [59] => getFields
    [60] => getTranslatableFields
    [61] => getIterator
    [62] => getFieldDefinition
    [63] => getFieldDefinitions
    [64] => toArray
    [65] => access
    [66] => language
    [67] => onChange
    [68] => getTranslation
    [69] => getUntranslated
    [70] => hasTranslation
    [71] => isNewTranslation
    [72] => addTranslation
    [73] => removeTranslation
    [74] => getTranslationLanguages
    [75] => updateOriginalValues
    [76] => __get
    [77] => __set
    [78] => __isset
    [79] => __unset
    [80] => createDuplicate
    [81] => __clone
    [82] => label
    [83] => referencedEntities
    [84] => bundleFieldDefinitions
    [85] => hasTranslationChanges
    [86] => enforceIsNew
    [87] => getEntityTypeId
    [88] => urlInfo
    [89] => toUrl
    [90] => hasLinkTemplate
    [91] => link
    [92] => toLink
    [93] => url
    [94] => uriRelationships
    [95] => save
    [96] => delete
    [97] => getEntityType
    [98] => preCreate
    [99] => preDelete
    [100] => postLoad
    [101] => getCacheContexts
    [102] => getCacheTagsToInvalidate
    [103] => getCacheTags
    [104] => getCacheMaxAge
    [105] => load
    [106] => loadMultiple
    [107] => create
    [108] => getOriginalId
    [109] => setOriginalId
    [110] => getTypedData
    [111] => getConfigDependencyKey
    [112] => getConfigDependencyName
    [113] => getConfigTarget
    [114] => addCacheContexts
    [115] => addCacheTags
    [116] => mergeCacheMaxAge
    [117] => addCacheableDependency
    [118] => traitSleep
    [119] => __wakeup
    [120] => getChangedTime
    [121] => setChangedTime
    [122] => getChangedTimeAcrossTranslations

Tags: