Extend the User getters and setters

I created an app to authenticate against a custom Single Sign On, I wanted to add a custom getter and setter to the user. As far as I can tell theirs no documentation on how to extend the user in any way other than using UserBackend, which that in itself has little to no documentation, so I am a little lost as to where to go from here.

For example if I added a field called “store_number”, what I want is to be able to make a function called “getStoreNumber” and a function called “setStoreNumber” that works alongside the other functions in the IUser.

I don’t think it’s possible (or advisable) to extend the user. Even if you could, there would be nobody to call either of the methods as they are custom to your app.

See Registering custom \OCP\IUserSession implementation - #4 by ChristophWurst for a related discussion about custom user back-ends.