tattersoftware / codeigniter4-relations

Entity relationships for CodeIgniter 4
MIT License
87 stars 20 forks source link

Not Posted related items are added automatically #18

Closed eafarooqi closed 2 years ago

eafarooqi commented 3 years ago

Hi,

looks like its related to the previous reported issue #17 , if related items are not posted in the form, they are added automatically in the related table.

$meeting= new Meeting($this->request->getPost());

if(!$meeting->roles){
     $meeting->roles = [];
}

$this->meetingModel->insert($meeting)

if roles are not posted, then have to set them as blank, otherwise few related items are added automatically to the table.

MGatner commented 3 years ago

Probably you're right that #17 fixes this. But what sort of model and database are you using that it inserts arrays?

eafarooqi commented 3 years ago

I mean multiple rows are inserted into database. using MySQL and CI default model

MGatner commented 3 years ago

Have you checked if this is still an issue?

MGatner commented 2 years ago

Closing as stale. Please reopen with more evidence if the issue persists.