Skip to content

Instantly share code, notes, and snippets.

@Pchelolo
Created June 5, 2020 16:48
Show Gist options
  • Save Pchelolo/b2f63171eb73143a5c7b4428979747a1 to your computer and use it in GitHub Desktop.
Save Pchelolo/b2f63171eb73143a5c7b4428979747a1 to your computer and use it in GitHub Desktop.
Introduce UserRecord and UserFactory
UserRecord is a value-object interface implemented by the old User class and a new UserRecordValue (or DatabaseUserRecord?) class. UserRecord extends UserIdentity and in addition defines the following methods:
hasLocalAccount
getRealName
isLocked (?!)
isHidden (?!)
getTouched/getDBTouched
getEmail
getEmailAuthenticationTimestamp
getRegistration
There should be a mutable version of UserRecord, or a builder, for use with updateUser().
Factory methods:
loadFromSession -> createUserFromSession() : UserRecord
loadDefaults -> createUserFromDefaults ( $name ) : UserRecord
newSystemUser
Move loadFromSession and friends to factory. Helps with removing dependency on WebRequest/Session from User
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment