A couple of previous questions have touched on this topic (how to add menu items, how to hide menu items), but I'm trying to figure out how to remove or empty a menu and then programmatically refill it. It seems like the task has three parts:
How do you delete an entire menu? Previous answers to manipulating menu items point to JNestedTable for menu manipulation, but I don't see a function for accomplishing this--only for deleting a generic row from a table using a primary key value. I could do this outside of the Joomla Framework using a SQL query, but I suspect that is the wrong approach (because it will mess up the lft and rgt values):
DELETE FROM menu WHERE menutype='name'
How do you add menu items? I believe this was answered here, but any other thoughts?
Once the menu is deleted and new menu items are added, how do you rebuild the menu? I know you can rebuild menus from the backend, but how can you do it programmatically?
Thanks so much!