Mage_Admin_Model_User
extends Mage_Core_Model_Abstract
in package
Table of Contents
Constants
- AUTH_ERR_2FA_INVALID : mixed = 3
- AUTH_ERR_ACCESS_DENIED : mixed = 2
- AUTH_ERR_ACCOUNT_INACTIVE : mixed = 1
- Authentication error codes
- XML_PATH_ADDITIONAL_EMAILS : mixed = 'general/additional_notification_emails/admin_u...
- Configuration paths for notifications
- XML_PATH_FORGOT_EMAIL_IDENTITY : mixed = 'admin/emails/forgot_email_identity'
- XML_PATH_FORGOT_EMAIL_TEMPLATE : mixed = 'admin/emails/forgot_email_template'
- Configuration paths for email templates and identities
- XML_PATH_MIN_ADMIN_PASSWORD_LENGTH : mixed = 'admin/security/min_admin_password_length'
- Configuration path for minimum length of admin password
- XML_PATH_NOTIFICATION_EMAILS_TEMPLATE : mixed = 'admin/emails/admin_notification_email_template'
- XML_PATH_STARTUP_PAGE : mixed = 'admin/startup/page'
Properties
- $_cacheTag : string|bool|array<string|int, mixed>
- Model cache tag for clear cache in after save and after delete
- $_data : array<string|int, mixed>|null
- Object attributes
- $_dataSaveAllowed : bool
- Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
- $_dirty : array<string|int, mixed>
- $_eventObject : string
- Parameter name in event
- $_eventPrefix : string
- Model event prefix
- $_hasAvailableResources : bool
- Available resources flag
- $_hasDataChanges : bool
- Data changes flag (true after setData|unsetData call)
- $_idFieldName : string
- Name of object id field
- $_isDeleted : bool
- Object delete flag
- $_isObjectNew : bool|null
- Flag which allow detect object state: is it new object (without id) or existing one (with id)
- $_oldFieldsMap : array<string|int, mixed>
- Map short fields names to its full names
- $_origData : array<string|int, mixed>|null
- Original data that was loaded
- $_resource : Mage_Core_Model_Resource_Db_Abstract
- Resource model instance
- $_resourceCollectionName : string
- Name of the resource collection model
- $_resourceName : string
- Name of the resource model
- $_role : Mage_Admin_Model_Roles
- Admin role
- $_syncFieldsMap : mixed
- Map of fields to sync to other fields upon changing their data
- $_underscoreCache : array<string|int, mixed>
- Setter/Getter underscore transformation cache
Methods
- __call() : mixed
- Set/Get attribute wrapper
- __construct() : mixed
- Constructor
- __get() : mixed
- Attribute getter (deprecated)
- __set() : mixed
- Attribute setter (deprecated)
- __toArray() : array<string|int, mixed>
- Convert object attributes to array
- _getResource() : Mage_Admin_Model_Resource_User
- Get resource instance
- add() : $this
- Assign user to role
- addData() : $this
- Add data to the object.
- afterCommitCallback() : $this
- Callback function which called after transaction commit in resource model
- afterLoad() : $this
- Object after load processing. Implemented as public interface for supporting objects after load in collections
- applyTwofaChange() : self
- Apply a 2FA on/off change. Turning 2FA on demands a valid code, otherwise the user saves a secret they never scanned and locks themselves out at the next login.
- authenticate() : bool
- Authenticate username and password and save loaded record
- changeResetPasswordLinkToken() : $this
- Change reset password link token
- cleanModelCache() : $this
- Remove model object related cache
- cleanPasswordsValidationData() : $this
- Clean password's validation data (password, current_password, new_password, password_confirmation)
- clearInstance() : $this
- Clearing object for correct deleting by garbage collector
- dataHasChangedFor() : bool
- Compare object data with original data
- debug() : string|array<string|int, mixed>
- Present object data as string in debug mode
- delete() : $this
- Delete object from database
- deleteFromRole() : $this
- Unassign user from his current role
- findFirstAvailableMenu() : string
- Find first menu item that user is able to access
- flagDirty() : $this
- getAclRole() : string
- Get user ACL role
- getBillingAddress() : Mage_Customer_Model_Address_Abstract
- getCacheIdTags() : array<string|int, mixed>|false
- Get cache tags associated with object id
- getCacheTags() : array<string|int, mixed>|false
- Get list of cache tags applied to model object.
- getCollection() : Mage_Admin_Model_Resource_User_Collection
- Retrieve admin user collection
- getCreated() : string
- getCreatedAt() : string
- getData() : mixed
- Object data getter
- getDataByKey() : mixed
- Get object data by particular key
- getDataByPath() : mixed
- Get object data by path
- getDataSetDefault() : mixed
- Fast get data or set default if value is not available
- getDataUsingMethod() : mixed
- Get object data by key with calling getter method
- getEmail() : string
- getEntityId() : int
- getExtra() : array<string|int, mixed>
- getFirstname() : string
- getId() : mixed
- Retrieve user identifier
- getIdFieldName() : string
- Retrieve identifier field name for model
- getIsActive() : int
- getLastname() : string
- getLogdate() : string
- getLognum() : int
- getMinAdminPasswordLength() : int
- Retrieve minimum length of admin password
- getModified() : string
- getName() : string
- Retrieve user name
- getNewPassword() : string
- getOrigData() : mixed
- Get object loaded data (original data)
- getPasskeyCreateArgs() : stdClass
- Get Passkey CreateArgs object
- getPasskeyCredentialIdHash() : string
- getPasskeyGetArgs() : stdClass
- Get Passkey GetArgs object
- getPasskeyPublicKey() : string
- getPassword() : string
- getPasswordConfirmation() : string
- getPasswordEnabled() : int
- getReloadAclFlag() : int
- getResource() : Mage_Admin_Model_Resource_User
- Retrieve model resource
- getResourceCollection() : Mage_Admin_Model_Resource_User_Collection
- Get collection instance
- getResourceName() : string
- Retrieve model resource name
- getRole() : Mage_Admin_Model_Roles
- Get admin role model
- getRoleId() : int
- getRoleIds() : array<string|int, mixed>
- getRoles() : array<string|int, mixed>
- Retrieve user roles
- getRpToken() : string
- getRpTokenCreatedAt() : string
- getShippingAddress() : Mage_Customer_Model_Address_Abstract
- getStartupPageUrl() : string
- Find admin start page url
- getTwofaEnabled() : int
- getTwofaSecret() : string|null
- Retrieve unencrypted value of twofa_secret
- getUserCreateAdditionalEmail() : array<string|int, mixed>
- Get additional emails for notification from config.
- getUserId() : int
- getUsername() : string
- hasAssigned2Role() : array<string|int, mixed>|null
- Check if user is assigned to any role
- hasAvailableResources() : bool
- Check if user has available resources
- hasData() : bool
- If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
- hasDataChanges() : bool
- Get data change status
- hasErrors() : bool
- hasNewPassword() : bool
- hasPassword() : bool
- hasPasswordConfirmation() : bool
- isDeleted() : bool
- Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
- isDirty() : bool
- isEmpty() : bool
- checks whether the object is empty
- isModuleEnabled() : bool
- isObjectNew() : bool
- Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
- isPasskeyEnabled() : bool
- isResetPasswordLinkTokenExpired() : bool
- Check if current reset password link token is expired
- jsonSerialize() : array<string|int, mixed>
- Implementation of JsonSerializable::jsonSerialize()
- load() : $this
- Load object data
- loadByUsername() : static
- login() : self
- offsetExists() : bool
- Implementation of ArrayAccess::offsetExists()
- offsetGet() : mixed
- Implementation of ArrayAccess::offsetGet()
- offsetSet() : void
- Implementation of ArrayAccess::offsetSet()
- offsetUnset() : void
- Implementation of ArrayAccess::offsetUnset()
- passwordHashNeedsUpgrade() : bool
- reload() : $this
- Reload current user
- roleUserExists() : bool
- Check if such combination role/user exists
- save() : $this
- Save object data
- saveExtra() : $this
- Save admin user extra data (like configuration sections state)
- saveRelations() : $this
- Save user roles
- sendAdminNotification() : $this
- Send notification to general Contact and additional emails when new admin user created.
- sendPasswordResetConfirmationEmail() : $this
- Send email with reset password confirmation link
- serialize() : string
- serialize object attributes
- setAttribute() : $this
- setCreated() : $this
- setCreatedAt() : $this
- setData() : $this
- Overwrite data in the object.
- setDataChanges() : $this
- Clears data changes status
- setDataUsingMethod() : $this
- Set object data with calling setter method
- setEmail() : $this
- setExtra() : $this
- setFirstname() : $this
- setId() : $this
- Declare model object identifier value
- setIdFieldName() : $this
- set name of object id field
- setIsActive() : $this
- setLastname() : $this
- setLogdate() : $this
- setLognum() : $this
- setModified() : $this
- setNewPassword() : $this
- setOrigData() : $this
- Initialize object original data
- setPasskeyCredentialIdHash() : $this
- setPasskeyData() : mixed
- Validate and set new passkey data
- setPasskeyPublicKey() : $this
- setPassword() : $this
- setPasswordConfirmation() : $this
- setPasswordEnabled() : $this
- setReloadAclFlag() : $this
- setRoleId() : $this
- setRoleIds() : $this
- setRoleUserId() : $this
- setRpToken() : $this
- setRpTokenCreatedAt() : $this
- setTwofaEnabled() : $this
- setTwofaSecret() : self
- Store encrypted value of twofa_secret
- setUpdatedAt() : $this
- setUserId() : $this
- setUsername() : $this
- toArray() : array<string|int, mixed>
- Public wrapper for __toArray
- toJson() : string
- Public wrapper for __toJson
- toString() : string
- Public wrapper for __toString
- toXml() : string
- Public wrapper for __toXml
- unsetData() : $this
- Unset data from the object.
- unsetOldData() : $this
- Unset old fields data from the object.
- unsNewPassword() : $this
- unsPasswordConfirmation() : $this
- userExists() : bool
- Check if user exists based on its id, username and email
- validate() : array<string|int, mixed>|true
- Validate user attribute values.
- validateCurrentPassword() : array<string|int, mixed>|true
- Validate password against current user password Returns true or array of errors.
- validatePasswordHash() : bool
- __toJson() : string
- Convert object attributes to JSON
- __toXml() : string
- Convert object attributes to XML
- _addFullNames() : mixed
- _afterDelete() : $this
- Processing object after delete data
- _afterDeleteCommit() : $this
- Processing manipulation after main transaction commit
- _afterLoad() : $this
- Processing object after load data
- _afterSave() : $this
- Processing object after save data
- _beforeDelete() : $this
- Processing object before delete data
- _beforeLoad() : $this
- Processing object before load data
- _beforeSave() : $this
- Processing object before save data
- _camelize() : string
- _clearData() : $this
- Clearing object's data
- _clearReferences() : $this
- Clearing cyclic references
- _construct() : void
- Initialize user model
- _getData() : mixed
- Get value from _data array without parse key
- _getEncodedPassword() : string
- Retrieve encoded password
- _getEventData() : array<string|int, mixed>
- Get array of objects transferred to default events processing
- _hasModelChanged() : bool
- Check whether model has changed data.
- _init() : mixed
- Standard model initialization
- _initOldFieldsMap() : mixed
- Inits mapping array of object's previously used fields to new fields.
- _prepareArray() : array<string|int, mixed>
- Set required array elements
- _prepareSyncFieldsMap() : $this
- Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
- _protectFromNonAdmin() : mixed
- Safeguard func that will check, if we are in admin area
- _setResourceModel() : mixed
- Set resource names
- _underscore() : string
- Converts field names for setters and getters
- getSession() : Mage_Admin_Model_Session
Constants
AUTH_ERR_2FA_INVALID
public
mixed
AUTH_ERR_2FA_INVALID
= 3
AUTH_ERR_ACCESS_DENIED
public
mixed
AUTH_ERR_ACCESS_DENIED
= 2
AUTH_ERR_ACCOUNT_INACTIVE
Authentication error codes
public
mixed
AUTH_ERR_ACCOUNT_INACTIVE
= 1
XML_PATH_ADDITIONAL_EMAILS
Configuration paths for notifications
public
mixed
XML_PATH_ADDITIONAL_EMAILS
= 'general/additional_notification_emails/admin_user_create'
XML_PATH_FORGOT_EMAIL_IDENTITY
public
mixed
XML_PATH_FORGOT_EMAIL_IDENTITY
= 'admin/emails/forgot_email_identity'
XML_PATH_FORGOT_EMAIL_TEMPLATE
Configuration paths for email templates and identities
public
mixed
XML_PATH_FORGOT_EMAIL_TEMPLATE
= 'admin/emails/forgot_email_template'
XML_PATH_MIN_ADMIN_PASSWORD_LENGTH
Configuration path for minimum length of admin password
public
mixed
XML_PATH_MIN_ADMIN_PASSWORD_LENGTH
= 'admin/security/min_admin_password_length'
XML_PATH_NOTIFICATION_EMAILS_TEMPLATE
public
mixed
XML_PATH_NOTIFICATION_EMAILS_TEMPLATE
= 'admin/emails/admin_notification_email_template'
XML_PATH_STARTUP_PAGE
public
mixed
XML_PATH_STARTUP_PAGE
= 'admin/startup/page'
Properties
$_cacheTag
Model cache tag for clear cache in after save and after delete
protected
string|bool|array<string|int, mixed>
$_cacheTag
= \false
When you use true - all cache will be clean
$_data
Object attributes
protected
array<string|int, mixed>|null
$_data
= []
$_dataSaveAllowed
Flag which can stop data saving after before save Can be used for next sequence: we check data in _beforeSave, if data are not valid - we can set this flag to false value and save process will be stopped
protected
bool
$_dataSaveAllowed
= \true
$_dirty
protected
array<string|int, mixed>
$_dirty
$_eventObject
Parameter name in event
protected
string
$_eventObject
= 'object'
In observe method you can use $observer->getEvent()->getObject() in this case
$_eventPrefix
Model event prefix
protected
string
$_eventPrefix
= 'admin_user'
$_hasAvailableResources
Available resources flag
protected
bool
$_hasAvailableResources
= \true
$_hasDataChanges
Data changes flag (true after setData|unsetData call)
protected
bool
$_hasDataChanges
= false
$_idFieldName
Name of object id field
protected
string
$_idFieldName
= null
$_isDeleted
Object delete flag
protected
bool
$_isDeleted
= false
$_isObjectNew
Flag which allow detect object state: is it new object (without id) or existing one (with id)
protected
bool|null
$_isObjectNew
= \null
$_oldFieldsMap
Map short fields names to its full names
protected
array<string|int, mixed>
$_oldFieldsMap
= []
$_origData
Original data that was loaded
protected
array<string|int, mixed>|null
$_origData
$_resource
Resource model instance
protected
Mage_Core_Model_Resource_Db_Abstract
$_resource
$_resourceCollectionName
Name of the resource collection model
protected
string
$_resourceCollectionName
$_resourceName
Name of the resource model
protected
string
$_resourceName
$_role
Admin role
protected
Mage_Admin_Model_Roles
$_role
$_syncFieldsMap
Map of fields to sync to other fields upon changing their data
protected
mixed
$_syncFieldsMap
= []
$_underscoreCache
Setter/Getter underscore transformation cache
protected
static array<string|int, mixed>
$_underscoreCache
= []
Methods
__call()
Set/Get attribute wrapper
public
__call(string $method, array<string|int, mixed> $args) : mixed
Parameters
- $method : string
- $args : array<string|int, mixed>
__construct()
Constructor
public
__construct() : mixed
By default, is looking for first argument as array and assigns it as object attributes This behaviour may change in child classes
__get()
Attribute getter (deprecated)
public
__get(string $var) : mixed
Parameters
- $var : string
__set()
Attribute setter (deprecated)
public
__set(string $var, mixed $value) : mixed
Parameters
- $var : string
- $value : mixed
__toArray()
Convert object attributes to array
public
__toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
array<string|int, mixed>_getResource()
Get resource instance
public
_getResource() : Mage_Admin_Model_Resource_User
Return values
Mage_Admin_Model_Resource_Useradd()
Assign user to role
public
add() : $this
Return values
$thisaddData()
Add data to the object.
public
addData(array<string|int, mixed> $arr) : $this
Retains previous data in the object.
Parameters
- $arr : array<string|int, mixed>
Return values
$thisafterCommitCallback()
Callback function which called after transaction commit in resource model
public
afterCommitCallback() : $this
Return values
$thisafterLoad()
Object after load processing. Implemented as public interface for supporting objects after load in collections
public
afterLoad() : $this
Return values
$thisapplyTwofaChange()
Apply a 2FA on/off change. Turning 2FA on demands a valid code, otherwise the user saves a secret they never scanned and locks themselves out at the next login.
public
applyTwofaChange(bool $enabled, string $verificationCode) : self
Parameters
- $enabled : bool
- $verificationCode : string
Tags
Return values
selfauthenticate()
Authenticate username and password and save loaded record
public
authenticate(string $username, string $password[, string|null $twofaVerificationCode = null ]) : bool
Parameters
- $username : string
- $password : string
- $twofaVerificationCode : string|null = null
Tags
Return values
boolchangeResetPasswordLinkToken()
Change reset password link token
public
changeResetPasswordLinkToken(string $newResetPasswordLinkToken) : $this
Stores new reset password link token and its creation time
Parameters
- $newResetPasswordLinkToken : string
Tags
Return values
$thiscleanModelCache()
Remove model object related cache
public
cleanModelCache() : $this
Return values
$thiscleanPasswordsValidationData()
Clean password's validation data (password, current_password, new_password, password_confirmation)
public
cleanPasswordsValidationData() : $this
Return values
$thisclearInstance()
Clearing object for correct deleting by garbage collector
public
final clearInstance() : $this
Return values
$thisdataHasChangedFor()
Compare object data with original data
public
dataHasChangedFor(string $field) : bool
Parameters
- $field : string
Return values
booldebug()
Present object data as string in debug mode
public
debug([mixed $data = null ][, array<string|int, mixed> &$objects = [] ]) : string|array<string|int, mixed>
Parameters
- $data : mixed = null
- $objects : array<string|int, mixed> = []
Return values
string|array<string|int, mixed>delete()
Delete object from database
public
delete() : $this
Tags
Return values
$thisdeleteFromRole()
Unassign user from his current role
public
deleteFromRole() : $this
Return values
$thisfindFirstAvailableMenu()
Find first menu item that user is able to access
public
findFirstAvailableMenu([Mage_Core_Model_Config_Element|Element $parent = null ][, string $path = '' ][, int $level = 0 ]) : string
Parameters
- $parent : Mage_Core_Model_Config_Element|Element = null
- $path : string = ''
- $level : int = 0
Return values
stringflagDirty()
public
flagDirty(string $field[, bool $flag = true ]) : $this
Parameters
- $field : string
- $flag : bool = true
Return values
$thisgetAclRole()
Get user ACL role
public
getAclRole() : string
Return values
stringgetBillingAddress()
public
getBillingAddress() : Mage_Customer_Model_Address_Abstract
Return values
Mage_Customer_Model_Address_AbstractgetCacheIdTags()
Get cache tags associated with object id
public
getCacheIdTags() : array<string|int, mixed>|false
Return values
array<string|int, mixed>|falsegetCacheTags()
Get list of cache tags applied to model object.
public
getCacheTags() : array<string|int, mixed>|false
Return false if cache tags are not supported by model
Return values
array<string|int, mixed>|falsegetCollection()
Retrieve admin user collection
public
getCollection() : Mage_Admin_Model_Resource_User_Collection
Attributes
- #[Override]
Return values
Mage_Admin_Model_Resource_User_CollectiongetCreated()
public
getCreated() : string
Return values
stringgetCreatedAt()
public
getCreatedAt() : string
Return values
stringgetData()
Object data getter
public
getData([string $key = '' ][, string|int $index = null ]) : mixed
If $key is not defined will return all the data as an array. Otherwise, it will return value of the element specified by $key. It is possible to use keys like a/b/c for access nested array data
If $index is specified it will assume that attribute data is an array and retrieve corresponding member. If data is the string - it will be explode by new line character and converted to array.
Parameters
- $key : string = ''
- $index : string|int = null
getDataByKey()
Get object data by particular key
public
getDataByKey(string $key) : mixed
Parameters
- $key : string
getDataByPath()
Get object data by path
public
getDataByPath(string $path) : mixed
Method consider the path as chain of keys: a/b/c => ['a']['b']['c']
Parameters
- $path : string
getDataSetDefault()
Fast get data or set default if value is not available
public
getDataSetDefault(string $key, mixed $default) : mixed
Parameters
- $key : string
- $default : mixed
getDataUsingMethod()
Get object data by key with calling getter method
public
getDataUsingMethod(string $key[, mixed $args = null ]) : mixed
Parameters
- $key : string
- $args : mixed = null
getEmail()
public
getEmail() : string
Return values
stringgetEntityId()
public
getEntityId() : int
Return values
intgetExtra()
public
getExtra() : array<string|int, mixed>
Return values
array<string|int, mixed>getFirstname()
public
getFirstname() : string
Return values
stringgetId()
Retrieve user identifier
public
getId() : mixed
Attributes
- #[Override]
getIdFieldName()
Retrieve identifier field name for model
public
getIdFieldName() : string
Attributes
- #[Override]
Return values
stringgetIsActive()
public
getIsActive() : int
Return values
intgetLastname()
public
getLastname() : string
Return values
stringgetLogdate()
public
getLogdate() : string
Return values
stringgetLognum()
public
getLognum() : int
Return values
intgetMinAdminPasswordLength()
Retrieve minimum length of admin password
public
getMinAdminPasswordLength() : int
Return values
intgetModified()
public
getModified() : string
Return values
stringgetName()
Retrieve user name
public
getName([string $separator = ' ' ]) : string
Parameters
- $separator : string = ' '
Return values
stringgetNewPassword()
public
getNewPassword() : string
Return values
stringgetOrigData()
Get object loaded data (original data)
public
getOrigData([string $key = null ]) : mixed
Parameters
- $key : string = null
getPasskeyCreateArgs()
Get Passkey CreateArgs object
public
getPasskeyCreateArgs() : stdClass
Tags
Return values
stdClassgetPasskeyCredentialIdHash()
public
getPasskeyCredentialIdHash() : string
Return values
stringgetPasskeyGetArgs()
Get Passkey GetArgs object
public
getPasskeyGetArgs() : stdClass
Tags
Return values
stdClassgetPasskeyPublicKey()
public
getPasskeyPublicKey() : string
Return values
stringgetPassword()
public
getPassword() : string
Return values
stringgetPasswordConfirmation()
public
getPasswordConfirmation() : string
Return values
stringgetPasswordEnabled()
public
getPasswordEnabled() : int
Return values
intgetReloadAclFlag()
public
getReloadAclFlag() : int
Return values
intgetResource()
Retrieve model resource
public
getResource() : Mage_Admin_Model_Resource_User
Return values
Mage_Admin_Model_Resource_UsergetResourceCollection()
Get collection instance
public
getResourceCollection() : Mage_Admin_Model_Resource_User_Collection
Return values
Mage_Admin_Model_Resource_User_CollectiongetResourceName()
Retrieve model resource name
public
getResourceName() : string
Return values
stringgetRole()
Get admin role model
public
getRole() : Mage_Admin_Model_Roles
Return values
Mage_Admin_Model_RolesgetRoleId()
public
getRoleId() : int
Return values
intgetRoleIds()
public
getRoleIds() : array<string|int, mixed>
Return values
array<string|int, mixed>getRoles()
Retrieve user roles
public
getRoles() : array<string|int, mixed>
Return values
array<string|int, mixed>getRpToken()
public
getRpToken() : string
Return values
stringgetRpTokenCreatedAt()
public
getRpTokenCreatedAt() : string
Return values
stringgetShippingAddress()
public
getShippingAddress() : Mage_Customer_Model_Address_Abstract
Return values
Mage_Customer_Model_Address_AbstractgetStartupPageUrl()
Find admin start page url
public
getStartupPageUrl() : string
Return values
stringgetTwofaEnabled()
public
getTwofaEnabled() : int
Return values
intgetTwofaSecret()
Retrieve unencrypted value of twofa_secret
public
getTwofaSecret() : string|null
Return values
string|nullgetUserCreateAdditionalEmail()
Get additional emails for notification from config.
public
getUserCreateAdditionalEmail() : array<string|int, mixed>
Return values
array<string|int, mixed>getUserId()
public
getUserId() : int
Return values
intgetUsername()
public
getUsername() : string
Return values
stringhasAssigned2Role()
Check if user is assigned to any role
public
hasAssigned2Role(int|Mage_Admin_Model_User $user) : array<string|int, mixed>|null
Parameters
- $user : int|Mage_Admin_Model_User
Return values
array<string|int, mixed>|nullhasAvailableResources()
Check if user has available resources
public
hasAvailableResources() : bool
Return values
boolhasData()
If $key is empty, checks whether there's any data in the object Otherwise checks if the specified attribute is set.
public
hasData([string $key = '' ]) : bool
Parameters
- $key : string = ''
Return values
boolhasDataChanges()
Get data change status
public
hasDataChanges() : bool
Return values
boolhasErrors()
public
hasErrors() : bool
Return values
boolhasNewPassword()
public
hasNewPassword() : bool
Return values
boolhasPassword()
public
hasPassword() : bool
Return values
boolhasPasswordConfirmation()
public
hasPasswordConfirmation() : bool
Return values
boolisDeleted()
Set _isDeleted flag value (if $isDeleted param is defined) and return current flag value
public
isDeleted([bool $isDeleted = null ]) : bool
Parameters
- $isDeleted : bool = null
Return values
boolisDirty()
public
isDirty([string $field = null ]) : bool
Parameters
- $field : string = null
Return values
boolisEmpty()
checks whether the object is empty
public
isEmpty() : bool
Return values
boolisModuleEnabled()
public
isModuleEnabled(string $moduleName[, string $helperAlias = 'core' ]) : bool
Parameters
- $moduleName : string
- $helperAlias : string = 'core'
Return values
boolisObjectNew()
Check object state (true - if it is object without id on object just created) This method can help detect if object just created in _afterSave method problem is what in after save object has id and we can't detect what object was created in this transaction
public
isObjectNew([bool $flag = null ]) : bool
Parameters
- $flag : bool = null
Return values
boolisPasskeyEnabled()
public
isPasskeyEnabled() : bool
Return values
boolisResetPasswordLinkTokenExpired()
Check if current reset password link token is expired
public
isResetPasswordLinkTokenExpired() : bool
Return values
booljsonSerialize()
Implementation of JsonSerializable::jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Prepares the object data for JSON serialization. Returns all object data as an array, with special handling for nested DataObject instances:
- If a nested DataObject has a custom jsonSerialize() implementation, it's preserved as-is
- If a nested DataObject has a custom toJson() method, it's converted to JSON string
- If a nested DataObject uses only the base implementations, it's excluded from output
This prevents infinite recursion and circular references when serializing object hierarchies.
Attributes
- #[Override]
Return values
array<string|int, mixed>load()
Load object data
public
load(string|null|int $id[, string|null $field = null ]) : $this
Parameters
- $id : string|null|int
- $field : string|null = null
Return values
$thisloadByUsername()
public
loadByUsername(string $username) : static
Parameters
- $username : string
Return values
staticlogin()
public
login(string $username, string $password[, string|null $twofaVerificationCode = null ]) : self
Parameters
- $username : string
- $password : string
- $twofaVerificationCode : string|null = null
Tags
Return values
selfoffsetExists()
Implementation of ArrayAccess::offsetExists()
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
Tags
Attributes
- #[Override]
Return values
booloffsetGet()
Implementation of ArrayAccess::offsetGet()
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
Tags
Attributes
- #[Override]
- #[ReturnTypeWillChange]
offsetSet()
Implementation of ArrayAccess::offsetSet()
public
offsetSet(string $offset, mixed $value) : void
Parameters
- $offset : string
- $value : mixed
Tags
Attributes
- #[Override]
offsetUnset()
Implementation of ArrayAccess::offsetUnset()
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
Tags
Attributes
- #[Override]
passwordHashNeedsUpgrade()
public
passwordHashNeedsUpgrade() : bool
Return values
boolreload()
Reload current user
public
reload() : $this
Return values
$thisroleUserExists()
Check if such combination role/user exists
public
roleUserExists() : bool
Return values
boolsave()
Save object data
public
save() : $this
Attributes
- #[Override]
Return values
$thissaveExtra()
Save admin user extra data (like configuration sections state)
public
saveExtra(array<string|int, mixed>|string $data) : $this
Parameters
- $data : array<string|int, mixed>|string
Return values
$thissaveRelations()
Save user roles
public
saveRelations() : $this
Tags
Return values
$thissendAdminNotification()
Send notification to general Contact and additional emails when new admin user created.
public
sendAdminNotification(Mage_Admin_Model_User $user) : $this
You can declare additional emails in Mage_Core general/additional_notification_emails/admin_user_create node.
Parameters
- $user : Mage_Admin_Model_User
Return values
$thissendPasswordResetConfirmationEmail()
Send email with reset password confirmation link
public
sendPasswordResetConfirmationEmail() : $this
Return values
$thisserialize()
serialize object attributes
public
serialize([array<string|int, mixed> $attributes = [] ][, string $valueSeparator = '=' ][, string $fieldSeparator = ' ' ][, string $quote = '"' ]) : string
Parameters
- $attributes : array<string|int, mixed> = []
- $valueSeparator : string = '='
- $fieldSeparator : string = ' '
- $quote : string = '"'
Return values
stringsetAttribute()
public
setAttribute(Mage_Eav_Model_Entity_Attribute_Abstract $value) : $this
Parameters
Return values
$thissetCreated()
public
setCreated(string $value) : $this
Parameters
- $value : string
Return values
$thissetCreatedAt()
public
setCreatedAt(string $currentTime) : $this
Parameters
- $currentTime : string
Return values
$thissetData()
Overwrite data in the object.
public
setData(string|array<string|int, mixed> $key[, mixed $value = null ]) : $this
$key can be string or array. If $key is string, the attribute value will be overwritten by $value
If $key is an array, it will overwrite all the data in the object.
Parameters
- $key : string|array<string|int, mixed>
- $value : mixed = null
Return values
$thissetDataChanges()
Clears data changes status
public
setDataChanges(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetDataUsingMethod()
Set object data with calling setter method
public
setDataUsingMethod(string $key[, mixed $args = [] ]) : $this
Parameters
- $key : string
- $args : mixed = []
Return values
$thissetEmail()
public
setEmail(string $value) : $this
Parameters
- $value : string
Return values
$thissetExtra()
public
setExtra(string $value) : $this
Parameters
- $value : string
Return values
$thissetFirstname()
public
setFirstname(string $value) : $this
Parameters
- $value : string
Return values
$thissetId()
Declare model object identifier value
public
setId(mixed $id) : $this
Parameters
- $id : mixed
Attributes
- #[Override]
Return values
$thissetIdFieldName()
set name of object id field
public
setIdFieldName(string $name) : $this
Parameters
- $name : string
Return values
$thissetIsActive()
public
setIsActive(int $value) : $this
Parameters
- $value : int
Return values
$thissetLastname()
public
setLastname(string $value) : $this
Parameters
- $value : string
Return values
$thissetLogdate()
public
setLogdate(string $value) : $this
Parameters
- $value : string
Return values
$thissetLognum()
public
setLognum(int $value) : $this
Parameters
- $value : int
Return values
$thissetModified()
public
setModified(string $value) : $this
Parameters
- $value : string
Return values
$thissetNewPassword()
public
setNewPassword(string $value) : $this
Parameters
- $value : string
Return values
$thissetOrigData()
Initialize object original data
public
setOrigData([string $key = null ][, mixed $data = null ]) : $this
Parameters
- $key : string = null
- $data : mixed = null
Return values
$thissetPasskeyCredentialIdHash()
public
setPasskeyCredentialIdHash(string $value) : $this
Parameters
- $value : string
Return values
$thissetPasskeyData()
Validate and set new passkey data
public
setPasskeyData(mixed $data) : mixed
Parameters
- $data : mixed
Tags
setPasskeyPublicKey()
public
setPasskeyPublicKey(string $value) : $this
Parameters
- $value : string
Return values
$thissetPassword()
public
setPassword(string $value) : $this
Parameters
- $value : string
Return values
$thissetPasswordConfirmation()
public
setPasswordConfirmation(string $value) : $this
Parameters
- $value : string
Return values
$thissetPasswordEnabled()
public
setPasswordEnabled(int $value) : $this
Parameters
- $value : int
Return values
$thissetReloadAclFlag()
public
setReloadAclFlag(int $value) : $this
Parameters
- $value : int
Return values
$thissetRoleId()
public
setRoleId(int $value) : $this
Parameters
- $value : int
Return values
$thissetRoleIds()
public
setRoleIds(array<string|int, mixed> $value) : $this
Parameters
- $value : array<string|int, mixed>
Return values
$thissetRoleUserId()
public
setRoleUserId(int $value) : $this
Parameters
- $value : int
Return values
$thissetRpToken()
public
setRpToken(string $value) : $this
Parameters
- $value : string
Return values
$thissetRpTokenCreatedAt()
public
setRpTokenCreatedAt(string $value) : $this
Parameters
- $value : string
Return values
$thissetTwofaEnabled()
public
setTwofaEnabled(int $value) : $this
Parameters
- $value : int
Return values
$thissetTwofaSecret()
Store encrypted value of twofa_secret
public
setTwofaSecret(string|null $secret) : self
Parameters
- $secret : string|null
Return values
selfsetUpdatedAt()
public
setUpdatedAt(string $currentTime) : $this
Parameters
- $currentTime : string
Return values
$thissetUserId()
public
setUserId(int $value) : $this
Parameters
- $value : int
Return values
$thissetUsername()
public
setUsername(string $value) : $this
Parameters
- $value : string
Return values
$thistoArray()
Public wrapper for __toArray
public
toArray([array<string|int, mixed> $arrAttributes = [] ]) : array<string|int, mixed>
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
array<string|int, mixed>toJson()
Public wrapper for __toJson
public
toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
Return values
stringtoString()
Public wrapper for __toString
public
toString([string $format = '' ]) : string
Will use $format as an template and substitute {{key}} for attributes
Parameters
- $format : string = ''
Return values
stringtoXml()
Public wrapper for __toXml
public
toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
- $rootName : string = 'item'
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
stringunsetData()
Unset data from the object.
public
unsetData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisunsetOldData()
Unset old fields data from the object.
public
unsetOldData([string $key = null ]) : $this
$key can be a string only. Array will be ignored.
Parameters
- $key : string = null
Return values
$thisunsNewPassword()
public
unsNewPassword() : $this
Return values
$thisunsPasswordConfirmation()
public
unsPasswordConfirmation() : $this
Return values
$thisuserExists()
Check if user exists based on its id, username and email
public
userExists() : bool
Return values
boolvalidate()
Validate user attribute values.
public
validate() : array<string|int, mixed>|true
Returns TRUE or array of errors.
Return values
array<string|int, mixed>|truevalidateCurrentPassword()
Validate password against current user password Returns true or array of errors.
public
validateCurrentPassword(string $password) : array<string|int, mixed>|true
Parameters
- $password : string
Return values
array<string|int, mixed>|truevalidatePasswordHash()
public
validatePasswordHash(string $string1, string $string2) : bool
Parameters
- $string1 : string
- $string2 : string
Return values
bool__toJson()
Convert object attributes to JSON
protected
__toJson([array<string|int, mixed> $arrAttributes = [] ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
Return values
string__toXml()
Convert object attributes to XML
protected
__toXml([array<string|int, mixed> $arrAttributes = [] ][, string $rootName = 'item' ][, bool $addOpenTag = false ][, bool $addCdata = true ]) : string
Parameters
- $arrAttributes : array<string|int, mixed> = []
-
array of required attributes
- $rootName : string = 'item'
-
name of the root element
- $addOpenTag : bool = false
- $addCdata : bool = true
Return values
string_addFullNames()
protected
_addFullNames() : mixed
_afterDelete()
Processing object after delete data
protected
_afterDelete() : $this
Return values
$this_afterDeleteCommit()
Processing manipulation after main transaction commit
protected
_afterDeleteCommit() : $this
Return values
$this_afterLoad()
Processing object after load data
protected
_afterLoad() : $this
Return values
$this_afterSave()
Processing object after save data
protected
_afterSave() : $this
Return values
$this_beforeDelete()
Processing object before delete data
protected
_beforeDelete() : $this
Return values
$this_beforeLoad()
Processing object before load data
protected
_beforeLoad(int $id[, string|null $field = null ]) : $this
Parameters
- $id : int
- $field : string|null = null
Return values
$this_beforeSave()
Processing object before save data
protected
_beforeSave() : $this
Attributes
- #[Override]
Return values
$this_camelize()
protected
_camelize(string $name) : string
Parameters
- $name : string
Return values
string_clearData()
Clearing object's data
protected
_clearData() : $this
Return values
$this_clearReferences()
Clearing cyclic references
protected
_clearReferences() : $this
Return values
$this_construct()
Initialize user model
protected
_construct() : void
Attributes
- #[Override]
_getData()
Get value from _data array without parse key
protected
_getData(string $key) : mixed
Parameters
- $key : string
_getEncodedPassword()
Retrieve encoded password
protected
_getEncodedPassword(string $password) : string
Parameters
- $password : string
Return values
string_getEventData()
Get array of objects transferred to default events processing
protected
_getEventData() : array<string|int, mixed>
Return values
array<string|int, mixed>_hasModelChanged()
Check whether model has changed data.
protected
_hasModelChanged() : bool
Can be overloaded in child classes to perform advanced check whether model needs to be saved e.g. using resourceModel->hasDataChanged() or any other technique
Return values
bool_init()
Standard model initialization
protected
_init(string $resourceModel) : mixed
Parameters
- $resourceModel : string
_initOldFieldsMap()
Inits mapping array of object's previously used fields to new fields.
protected
_initOldFieldsMap() : mixed
Must be overloaded by descendants to set concrete fields map.
_prepareArray()
Set required array elements
protected
_prepareArray(array<string|int, mixed> &$arr[, array<string|int, mixed> $elements = [] ]) : array<string|int, mixed>
Parameters
- $arr : array<string|int, mixed>
- $elements : array<string|int, mixed> = []
Return values
array<string|int, mixed>_prepareSyncFieldsMap()
Called after old fields are inited. Forms synchronization map to sync old fields and new fields between each other.
protected
_prepareSyncFieldsMap() : $this
Return values
$this_protectFromNonAdmin()
Safeguard func that will check, if we are in admin area
protected
_protectFromNonAdmin() : mixed
Tags
_setResourceModel()
Set resource names
protected
_setResourceModel(string $resourceName[, string|null $resourceCollectionName = null ]) : mixed
If collection name is omitted, resource name will be used with _collection appended
Parameters
- $resourceName : string
- $resourceCollectionName : string|null = null
_underscore()
Converts field names for setters and getters
protected
_underscore(string $name) : string
$this->setMyField($value) === $this->setData('my_field', $value) Uses cache to eliminate unnecessary preg_replace
Parameters
- $name : string
Return values
stringgetSession()
protected
getSession() : Mage_Admin_Model_Session