XF 2.2 easy saving?

briansol

Well-known member
I'm working through saving my form data to the DB.

Through reverse engineering, i'm finding the process XF uses with the service/ calls to be WAY overkill for my needs.

Is there a 'simpler' approach? Can i just spawn an entity through _em instance and ->save() to it in my controller instead of going through the preparer and creator and editor services?

My data will all be admin/mod generated (controlled by permissions) but lives in the regular xf area (not admin). So, i'm less concerned about checking things like spam, ips, spawning notifications, behaviors, and all the rest.
 
Most default controllers don't use any preparers either. They're pretty much exclusively used in the context of big text messages that need to go through multiple different stages like spam check, etc. You can check src/XF/Admin/Controller/RouteFilter::actionSave and routeFilterSaveProcess for one of the most minimalistic examples of a simple save action.
 
Back
Top Bottom