eibrahimov Posted May 4, 2016 Share Posted May 4, 2016 (edited) 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 May 4, 2016 by eibrahimov (see edit history) Link to comment Share on other sites More sharing options...
eibrahimov Posted May 4, 2016 Author Share Posted May 4, 2016 From the ObjectModel class has attribute "force_id". I love PrestaShop. /** @var bool Enables to define an ID before adding object. */public $force_id = false; 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now