I want to remove a set of users by id from a Joomla 3.x database. I am trying to figure out from the documentation if this is possible without having to write my own SQL for each database table.
Something like the following pseudo code:
delete from #_users where ( `lastvisitDate` < NOW() - INTERVAL 1 MONTH ) AND ( #__user_usergroup_map.group_id = 18 ); delete from #_user_usergroup_map where user_id not in (select id from #_users); delete from #_user_profiles where user_id not in (select id from #_users);
I am familiar with the querybuilder see: https://docs.joomla.org/Inserting,_Updating_and_Removing_data_using_JDatabase/en
But if there is already code in the framework that deletes user's with details then it would be my preference not to reinvent the wheel.
The documentations has this : https://api.joomla.org/cms-3/classes/Joomla.CMS.User.User.html but it seems that no parameters are passed to user->delete?
I'm assuming this can be done as it is possible to tick boxes in the administrator back end user list and delete multiple users.
I have been working with Joomla for a few years (since 1.5) but truth be told I have always struggled with the API documentation.
Any help would be greatly appreciated.