codeigniter-base-model icon indicating copy to clipboard operation
codeigniter-base-model copied to clipboard

Unused third param for insert_many call to insert?

Open Cipa opened this issue 10 years ago • 2 comments

Hi,

Is there a reason for the existence of the third param on line 240?

$ids[] = $this->insert($row, $skip_validation, ($key == count($data) - 1));

Thanks

Cipa avatar Jun 13 '14 18:06 Cipa

It seems to be passing a boolean argument, being 'true' if it is the last iteration of the loop.

However, looking at line 207 (this insert method being called form line 240), no third argument is listed.

This value could still be accessed using func_get_args(), which @jamierumbelow uses through the base model, however I do not yet see how it is used.

kbjohnson90 avatar Jun 13 '14 18:06 kbjohnson90

I think this is a hangover from a previous version of the code (where I needed the last iteration of the loop). Don't worry about it – I got rid of it a while ago and must have forgotten to delete this line :-)

jamierumbelow avatar Jun 14 '14 14:06 jamierumbelow