Jump to content

That is Best practice to manage objects? Webservice or Direct DB update?


Recommended Posts

  • 4 weeks later...

Hello everyone

 

That is the best practice to create and manage orders and other objects in modules?

Webservice or Direct DB editing by php functions, prestashop controllers and classes methods?

 

Have a nice day

Eugene

 

Hello,

 

if you're going to write a module, try to stick to the existing functions. That doesn't meand, that you wouldn't have to write your own queries, but even than, use the DB class to fetch and write. If you need to display and edit objects of any kind, look at the helper classes. These will help you, to develop grids and such much faster.

Webservices are nice, if you want to let 2 servers to communicate with each other. But even the webservices rely on the core classes :).

If you once got the basic object & controller model, you will be able to quickly check, which functions could be reuses and which need to be written by you.

Last but not least, whenever possible, use hooks instead of overwrites, nevertheless this doesn't work in every case, or sometimes you would have to spend 5x more time to shio around.

 

Regards

Peter

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...