I'm developing a php script to import and keep synced a prestashop database with data coming from a management software.
Is it a good method to insert data directly on the database or is it better to use the prestashop classes.
Can you give an exemple how to import categories with class method?
Try this :
$category = new Category;
$category->id = 155;
$category->active = 0;
$category->id_parent = 15;
$category->name = "category";
$category->link_rewrite = "one-category";
//this will force ObjectModel to use your ID
$_GET['forceIDs'] = true;
$category->add();