Jump to content

How to set primary ID when create new Object Model record in PrestaShop?


eibrahimov

Recommended Posts

I want check if ID reserved in DB, delete it and add new record with this ID. It's for if not (for example) ID 2 in database create record with ID 2. It's need to our current task. Thank you. have any ideas? 

$model = new TaxRulesGroup(2);
$model->delete();

$model->id = 2;
$model->id_tax_rules_group = 2;
$model->name = 'new name';
$model->active = 1;

$model->add();
Edited by eibrahimov (see edit history)
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...