Set quota programmatically

Hi, I have written an external authentication app, and want to customize quota for certain users. With earlier versions of OC, it was possible by using this code:

\OCP\Config::setUserValue($uid, 'files', 'quota', $quota);

Now it doesn’t work, how do I set quota in modern version of OC?

Take a look at the Provisioning API.

Edit User

Edits attributes related to a user. Users are able to edit email, displayname and password; admins can also edit the quota value. Exactly one attribute can be set or modified at a time. To set or modify multiple attributes then multiple calls must be made